MySQL Select Count Distinct – Counting and Identifying Duplicate Records
Looking for a [relatively] quick way to identify duplicate records in a table and list how many records there are for each duplicate? Look no further.
In my case, I’ve got a table named Searches which tracks queries on one of my sites. I wanted to check the top queries, so I used this SQL statement:
There you have it. A simple, effective way to count and label duplicate records.
Categories: Uncategorized
![[del.icio.us]](http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png)
![[Reddit]](http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png)