Skip to content

Instantly share code, notes, and snippets.

@paulocanedo
Created July 12, 2014 01:11
Show Gist options
  • Save paulocanedo/d5db3d827dd8982a085e to your computer and use it in GitHub Desktop.
Save paulocanedo/d5db3d827dd8982a085e to your computer and use it in GitHub Desktop.
SELECT DISTINCT A.ID, A.title, A.file_path, B.Count
FROM tracks A
inner JOIN (
SELECT COUNT(*) as Count, B.title
FROM tracks B
GROUP BY B.title
) AS B ON A.title = B.title
WHERE B.Count > 1
ORDER by A.title;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment