Last active
January 4, 2016 14:52
-
-
Save StephaneTy-Pro/122a1fac03cd5883f501 to your computer and use it in GitHub Desktop.
SQL doublons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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