ORACLE 重复数据修改其中一条

oracle更新bai数据两du条以上相同zhi则只更dao新一zhuan条
update 表名shu t
set t.st = '1'
where rowidtochar(rowid) in
(select t2.r1
from (select rowidtochar(rowid) r1,
row_number() over(partition by t.id, t.na order by 1) r2
from 表名 t
where t.st = '0') t2
where t2.r2 = 1);

posted @ 2021-01-07 16:02  不会游泳的鱼丶  阅读(1150)  评论(0)    收藏  举报