Click to See Complete Forum and Search --> : remove duplicate entry


haroon373
08-12-2008, 05:56 AM
how can i remove duplicate entries or rows from a table by spcifying a field

like in psudo code

delete from table where topic is duplicate

i know this is not right but i just clarifying

atf311
08-12-2008, 10:07 PM
If you want one row to remain as a non duplicate then you First need to decide how you are going to specify which row will not be deleted.

If you just want to delete them all then you could probably use something like :

DELETE topic FROM myTable
WHERE topic in (SELECT topic from myTable where count(topic) > 1);