oracle常用sql集锦

1、删除表中重复的数据只留下一条:

DELETE fromWHERE (id) IN ( SELECT id FROMGROUP BY id HAVING COUNT(id) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROMGROUP BY id HAVING COUNT(*) > 1);

 

posted @ 2019-06-12 09:54  敲代码的小浪漫  阅读(555)  评论(0编辑  收藏  举报