Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql delete duplicate rows except one

DELETE FROM NAMES
 WHERE id NOT IN (SELECT * 
                    FROM (SELECT MIN(n.id)
                            FROM NAMES n
                        GROUP BY n.name) x)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #delete #duplicate #rows
ADD COMMENT
Topic
Name
4+1 =