方法一:
在oracle里面的序号一般使用row_number() over(ORDER BY 列名) 分析函数
语法格式:row_number() over(partition by 分组列 order by 排序列 desc);
UPDATE PT_DXSL_KZ_XT5 a
SET id1 = (
SELECT b.rowno
FROM
(SELECT row_number() over(ORDER BY id) rowno, ROWID browid FROM PT_DXSL_KZ_XT5) b
WHERE a.rowid = b.browid
)
网上的例子:
UPDATE WX_SCHOOL a
SET a.SYS_CODE=(
SELECT b.rowno
FROM (SELECT row_number() over(ORDER BY t.id) rowno, ROWID browid from WX_SCHOOL t ) b
WHERE b.browid = a.rowid
)
方法二:
(5条消息) Oracle中为某列加序号(测试)_LOW姿态的博客-CSDN博客
2022-10-25
网友评论