Counting Duplicate Records
We all need to do it once in a while, and for me it takes a little time to remember the best way to do it. I found a post by Pinal Dave that gives a great example.
SELECT YourColumn, COUNT(*) TotalCount FROM YourTable GROUP BY YourColumn HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC
Posted on May 3, 2011, in Bits, SQL and tagged SQL. Bookmark the permalink. Leave a comment.
Leave a comment
Comments 0