Skip to content

Instantly share code, notes, and snippets.

@stefanbirkner
Created January 11, 2012 10:29
Show Gist options
  • Select an option

  • Save stefanbirkner/1594072 to your computer and use it in GitHub Desktop.

Select an option

Save stefanbirkner/1594072 to your computer and use it in GitHub Desktop.
list duplicate rows with the number of duplicates
-- replace myfield1, myfield2 and mytable with appropriate names
select COUNT(*) AS num, myfield1, myfield2 from mytable group by myfield1, myfield2 HAVING COUNT(*) > 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment