SQL语句之查找重复记录和唯一记录

查找唯一记录

SELECT DISTINCT * FROM people;

查找重复记录

SELECT * 
FROM people
WHERE peopleID in (
SELECT peopleID 
FROM people
GROUP BY peopleID HAVING count(peopleID)>1);

  2021-08-30 22:13:35

posted @ 2021-08-30 22:14  ruishu_0726  阅读(549)  评论(0编辑  收藏  举报