Ħassar ir-Ringieli Duplikati kollha ħlief għal Wieħed fil-MySQL? [duplikat]
It-tabella tal-utent għandha 5 rekords b'email doppju ta' [email protected]
Fittex jirritorna l-emails duplikati fit-tabella Utenti:
SELECT *, COUNT(email) FROM users
GROUP BY email
HAVING COUNT(email) > 1;
Ħassar ringieli duplikati billi tuża dikjarazzjoni DELETE JOIN
DELETE table1 FROM users table1
INNER JOIN users table2
WHERE table1.id < table2.id AND table1.email = table2.email
Riżultat