Wednesday, 11 September 2013

delete duplicate record that not having any primary id in sql

delete duplicate record that not having any primary id in sql

i have one table name ComplimentTransactAssign_tbl in this table i have
lot of duplicate entries.my table structure like this:
TransactID Cmplid
32 16
105 17
105 17
290 12
32 16 290 12 i find out my duplicate recordes like this: select TransactID
from ComplimentTransactAssign_tbl group by TransactID having count(*) >1
order by TransactID i want to delete one duplicate recored..after deleting
i want to get expected out put like this:
TransactID Cmplid
32 16
105 17
290 12

No comments:

Post a Comment