Posted By

marrouchi on 03/06/14


Tagged


Versions (?)

Count how many duplicates you have in a table


 / Published in: MySQL
 

Count how many duplicates you have in a table

  1. SELECT COUNT(alias.id) FROM (SELECT id, COUNT(id) AS cnt
  2. FROM table
  3. GROUP BY id
  4. HAVING (cnt > 1)) as alias

Report this snippet  

You need to login to post a comment.