/ Published in: MySQL

Count how many duplicates you have in a table
Expand |
Embed | Plain Text
SELECT COUNT(alias.id) FROM (SELECT id, COUNT(id) AS cnt FROM table GROUP BY id HAVING (cnt > 1)) as alias
You need to login to post a comment.