renumbering the data in a column?
Date: Wed, 14 Jan 2009 20:02:08 GMT
I have some rows that I would like to renumber. For example:
select * from t where name like 'x%' order by seq;
- ---- 15 xfoo 17 xbar 26 xbaz
desired state, seq column renumbered starting at 1:
- ---- 1 xfoo 2 xbar 3 xbaz
Is there a single sql statement that can do this? Or should I just loop over the result set and manually update the seq for each row?
-- Mark Harrison Pixar Animation StudiosReceived on Wed Jan 14 2009 - 14:02:08 CST