Delete Duplicate Records in DataBase sql server

if your Tabel has a duplicate data and you want to delete only duplicate records and want to save only single records in your table then this single line of code will help you..........



select * from tblname where tblname. %%physloc%% not in(select MAX(b.%%physloc%%)  from tblname   group by b.coloumnname)

Hope it helped you........
plz comments.........

Comments

Post a Comment

Popular posts from this blog

i am writing With sad hearts some problems with my windows phone samsung omnia w