刪除oracle重複值

weixin_44043580發表於2020-10-13

例子 表為:bdc_djlx 主鍵為:id

sql語句
DELETE from bdc_fj WHERE (id) IN ( SELECT id FROM  bdc_fj GROUP BY id HAVING COUNT(id) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROM  bdc_fj GROUP BY id HAVING COUNT(*) > 1);

相關文章