I’ve got this to find all duplicates in my db:
SELECT phone, count(*) AS ct FROM table GROUP BY `phone` HAVING ct >1
This results in 12 rows but the sum of ct of those 12 rows equals 26:
phone ct
3600000000 4
3602931205 2
3602933399 2
3602933736 2
3602936241 2
3602937911 2
3602939287 2
3602939353 2
3602939767 2
3603174530 2
3606612300 2
3608995913 2
How can I modify the query to tell me the total of ct?
Try this::