oracle 联合主键去重,并删除重复数据
程序员文章站
2022-06-02 13:02:39
...
---去重
select XK_XDR_MC, XK_LYDWDM, XK_XKJGDM, XK_WSH, XK_JDRQ, XK_XKBH, count(1)
from T_XZxks
group by XK_XDR_MC, XK_LYDWDM, XK_XKJGDM, XK_WSH, XK_JDRQ, XK_XKBH
having count(1) > 1
--删除重复
delete from T_XZxks where rowid not in(
select max(rowid) from T_XZxks group by(XK_XDR_MC, XK_LYDWDM, XK_XKJGDM, XK_WSH, XK_JDRQ, XK_XKBH));
上一篇: Oracle数据库之(六)Oracle数据库对象(过程、函数、视图、序列)
下一篇: MySQL优化