赞
踩
在Oracle数据库中删除重复数据
Person01
表:
SELECT * FROM PERSON01 WHERE ID IN (SELECT ID FROM PERSON01 GROUP BY ID HAVING COUNT(ID) > 1)
DELETE FROM PERSON01 WHERE (ID) IN (SELECT ID FROM PERSON01 GROUP BY ID HAVING COUNT(ID) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROM PERSON01 GROUP BY ID HAVING COUNT(*) > 1);
SELECT * FROM PERSON01 A WHERE (A.ID, A.PERSON01) IN(SELECT ID, PERSON01 FROM PERSON01 GROUP BY ID, PERSON01 HAVING COUNT(*) > 1)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。