Skip to content

Instantly share code, notes, and snippets.

@StephaneTy-Pro
Last active January 4, 2016 14:52
Show Gist options
  • Select an option

  • Save StephaneTy-Pro/122a1fac03cd5883f501 to your computer and use it in GitHub Desktop.

Select an option

Save StephaneTy-Pro/122a1fac03cd5883f501 to your computer and use it in GitHub Desktop.
SQL doublons
http://sql.sh/55-requete-trouver-doublon
Doublons absolus
SELECT COUNT(*) AS nbr_doublon, champ1, champ2, champ3
FROM table
GROUP BY champ1, champ2, champ3
HAVING COUNT(*) > 1
Doublons sur colonne email par exemple
SELECT COUNT(email) AS nbr_doublon, email
FROM utilisateur
GROUP BY email
HAVING COUNT(email) > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment