oracle常用sql集锦
发布时间:2021-02-27 18:03:59 所属栏目:站长百科 来源:网络整理
导读:1、删除表中重复的数据只留下一条: DELETE from 表 WHERE (id) IN ( SELECT id FROM 表 GROUP BY id HAVING COUNT (id) 1 ) AND ROWID NOT IN ( SELECT MIN (ROWID) FROM 表 GROUP BY id HAVING COUNT ( * ) 1 );
1、删除表中重复的数据只留下一条: DELETE from 表 WHERE (id) IN ( SELECT id FROM 表 GROUP BY id HAVING COUNT(id) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROM 表 GROUP BY id HAVING COUNT(*) > 1); (编辑:上饶站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐
热点阅读