Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql - Count all duplicates of each value

SELECT   col,
         COUNT(dupe_col) AS dupe_cnt
FROM     TABLE
GROUP BY col
HAVING   COUNT(dupe_col) > 1
ORDER BY COUNT(dupe_col) DESC
Source by sqlerrors.com #
 
PREVIOUS NEXT
Tagged: #sql #Count #duplicates
ADD COMMENT
Topic
Name
1+2 =