Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这张桌子:
old_id integer NOT NULL, new_id integer
现在我想以保留new_id顺序的方式更新一个序列。old_id基本上:
new_id
old_id
update table set new_id = sequence.NEXTVAL order by old_id
这样的事情可能吗?如果重要的话,我在 Oracle 10g 上。
update (select * from mytable order by old_id) set new_id = mysequence.nextval;