我有一个这样的 Oracle 表:
fruit id
-------- -----
apple 1
plum 9
pear 55
orange 104
..
id 列号错误。我怎样才能像这样更新要重新排序的每一行的 id:
fruit id
-------- -----
apple 1
plum 2
pear 3
orange 4
执行此操作最有效的方法是什么?
最佳答案
update your_table
set id = rownum
关于sql - 如何重新排序 oracle 表 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15883870/