So nach mehreren Stunden habe ich die Lösung. Man muss ein multi-table DELETE machen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
-- doppelte ids anzeigen lassen - mit limit zum testen SELECT `auto_id` FROM `import_drag_xmlfiles_alle` AS a WHERE a.`auto_id` IN ( SELECT `import_drag_xmlfiles_alle`.`auto_id` FROM `import_drag_xmlfiles_alle` , `import_drag_xmlfiles_alle` T2 WHERE NOT `import_drag_xmlfiles_alle`.`auto_id` = T2.`auto_id` AND `import_drag_xmlfiles_alle`.`partNumber` = T2.`partNumber` AND `import_drag_xmlfiles_alle`.`auto_id` > T2.`auto_id` ) LIMIT 10 -- doppelte einträge löschen - v1 - FULL TABLE JOIN DELETE `import_drag_xmlfiles_alle` FROM `import_drag_xmlfiles_alle` , `import_drag_xmlfiles_alle` T2 WHERE NOT `import_drag_xmlfiles_alle`.`auto_id` = T2.`auto_id` AND `import_drag_xmlfiles_alle`.`partNumber` = T2.`partNumber` AND `import_drag_xmlfiles_alle`.`auto_id` > T2.`auto_id` -- doppelte einträge löschen - v2 - JOIN mit USING DELETE FROM `import_drag_xmlfiles_alle` USING `import_drag_xmlfiles_alle`, `import_drag_xmlfiles_alle` as T2 WHERE NOT `import_drag_xmlfiles_alle`.`auto_id` = T2.`auto_id` AND `import_drag_xmlfiles_alle`.`auto_id` > T2.`auto_id` AND `import_drag_xmlfiles_alle` .`partNumber` = T2.`partNumber` |