Hãy thử truy vấn này -
DELETE t1 FROM studios t1
JOIN (SELECT MIN(id) id, name, email FROM studios GROUP BY name, email) t2
ON t1.id <> t2.id AND t1.name = t2.name AND t1.email = t2.email;
Hãy thử truy vấn này -
DELETE t1 FROM studios t1
JOIN (SELECT MIN(id) id, name, email FROM studios GROUP BY name, email) t2
ON t1.id <> t2.id AND t1.name = t2.name AND t1.email = t2.email;