Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Search Your Question

Monday, May 5, 2008

How will you delete duplicate records/rows from a database table?

We can use the following query

select distinct * into #temptable
from mainTable

truncate table mainTable

insert mainTable
select *
from #temptable

drop table #temptable

No comments:

Archives