Skip to content

Instantly share code, notes, and snippets.

@2803media
Last active November 8, 2020 19:58
Show Gist options
  • Select an option

  • Save 2803media/9251644 to your computer and use it in GitHub Desktop.

Select an option

Save 2803media/9251644 to your computer and use it in GitHub Desktop.
doublon mysql
SELECT DISTINCT (c1.id), c1 . * FROM cm_service_CAF c1 LEFT OUTER JOIN cm_service_CAF c2 ON c2.id != c1.id AND c2.CODGEO = c1.CODGEO WHERE c2.id IS NOT NULL
### Plus rapide
SELECT COUNT(*) AS nbr_doublon, identifiant FROM cm_users GROUP BY identifiant HAVING COUNT(*) > 1
#delete
ALTER IGNORE TABLE cm_dvfdatas
ADD UNIQUE INDEX CODGEO (CODGEO);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment