delete duplicates of 3 column combination
Posted on 2012-04-06
select COUNT(*),COL1,COL2,COL3 from tblOCDELStudent_1011 group by COL1,COL2,COL3 having COUNT(*) >1
gives records that have the combination of COL1,COL2,COL3 more than once..
how can we eliminate duplicates that all of them will have exactly one count only.. that is, the above query should give no results at all, and so we can delete ..
if the count is 3 it should have 2 deletes.. and if 4, then 3 and so forth..