Hodžův blog

23 Led

MySQL – Remove Duplicate Data or Rows

DELETE FROM mytable
USING mytable, mytable as virtualtable
WHERE (NOT mytable.id=virtualtable.id)
AND (mytable.fieldname=virtualtable.fieldname)

Simple isn’t it?

Leave a Reply

Hodžův blog is is proudly powered by Wordpress and the Magellan Theme