DELETE FROM table WHERE name IN (SELECT name FROM table GROUP BY name HAVING COUNT(*) > 1) AND NOT id IN (SELECT min(id) FROM table GROUP BY name)
This code snippet is for to delete duplicate records in sql without using temporary table.
This code snippet is for to delete duplicate records in sql without using temporary table.
DELETE FROM table WHERE name IN (SELECT name FROM table GROUP BY name HAVING COUNT(*) > 1) AND NOT id IN (SELECT min(id) FROM table GROUP BY name)