Skip to content

Instantly share code, notes, and snippets.

@jazlopez
Created March 20, 2016 20:42
Show Gist options
  • Save jazlopez/4f45d2331269c518c7ca to your computer and use it in GitHub Desktop.
Save jazlopez/4f45d2331269c518c7ca to your computer and use it in GitHub Desktop.
MYSQL | Comma separated list of ids from duplicated values in a field name
SELECT GROUP_CONCAT(id), EMAIL, COUNT(*) as COUNT
FROM customer
GROUP BY email
HAVING COUNT(*) >= 2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment