Monday, December 15, 2008

Easy remove duplicates from table (database platform neutral)

DELETE FROM table_name
WHERE "id" NOT IN
(SELECT MAX("dt"."id")
FROM table_name As dt
GROUP BY "dt"."field_that_records_have_duplicate_info_in", "dt"."another_field_that_records_have_duplicate_info_in");

0 Comments:

Post a Comment

<< Home