Files
varlog/_cache/articles/f6266a61-7cac-4aa3-94db-7f977f03dff3.json
T
2026-05-15 10:37:48 +02:00

1 line
1.2 KiB
JSON

{"uuid":"f6266a61-7cac-4aa3-94db-7f977f03dff3","slug":"trouver-des-doublons","title":"Trouver les doublons","author":"cedric@abonnel.fr","published":true,"published_at":"2023-02-09 23:11:08","created_at":"2023-02-09 23:11:08","updated_at":"2023-02-09 23:11:08","revisions":[],"cover":"","files_meta":[],"external_links":[],"seo_title":"","seo_description":"","og_image":"","category":"Informatique","content":"# Trouver les doublons\n\n![Trouver des doublons en SQL](sql_table_records.jpg)\n\n<panel type=\"default\" title=\"Code SQL\">\n<code SQL [enable_line_numbers=\"true\", start_line_numbers_at=\"1\"]>\nSELECT COUNT(*) AS nbr_doublon, champ1, champ2, champ3\nFROM table\nGROUP BY champ1, champ2, champ3\nHAVING COUNT(*) > 1\n</code>\n</panel>\n\n<panel type=\"default\" title=\"Code SQL\">\n<code SQL [enable_line_numbers=\"true\", start_line_numbers_at=\"1\"]>\nSELECT DISTINCT *\nFROM table t1\nWHERE EXISTS (\n SELECT *\n FROM table t2\n WHERE t1.ID <> t2.ID\n AND t1.champ1 = t2.champ1\n AND t1.champ2 = t2.champ2\n AND t1.champ3 = t2.champ3 )\n</code>\n</panel>","featured":false,"tags":[]}