MySQL how to delete duplicate records in a table with a single query
DELETE s1
FROM table s1
JOIN( SELECT MIN(id) id, phone, fio FROM table GROUP BY phone, fio) s2
ON s1.id != s2.id
AND s1.phone = s2.phone
AND s1.fio = s2.fio
thanks )
Comments
To leave a comment
If you have any suggestion, idea, thanks or comment,
feel free to write. We really value feedback and are glad to hear your opinion.
Comments