Finding duplicate values in a SQL table

后端 未结 30 4676
南旧
南旧 2020-11-21 13:18

It\'s easy to find duplicates with one field:

SELECT name, COUNT(email) 
FROM users
GROUP BY email
HAVING COUNT(email) > 1

So if we have

30条回答
  •  佛祖请我去吃肉
    2020-11-21 13:46

    How we can count the duplicated values?? either it is repeated 2 times or greater than 2. just count them, not group wise.

    as simple as

    select COUNT(distinct col_01) from Table_01
    

提交回复
热议问题