Showing posts with label identical. Show all posts
Showing posts with label identical. Show all posts

Tuesday, November 18, 2008

sql2000 delete rows having duplicate (identical) records

Suppose, we have identical records like :-

name age
***********
RAM 30
RAM 30

we have to keep one entry each for ram:30  and ram:40 and delete duplicate entries:-

set rowcount 1 
(this will remove top 1 row)
select * from temp where name = 'ram'
delete temp where name = 'ram'
set rowcount 0