How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / gaurav jain
begin
select distinct * into #one from four where id in (select
id from four group by id
having count(*)>1)
delete from four where id in (select id from four group by
id having count(*)>1)
insert into four select * from #one
end
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is public role in sql server?
What is unpivot?
How to find out what is the default collation in a database?
Why we use the openxml clause?
What do you mean by an execution plan? Why is it used? How would you view it?
What is right outer join in sql server joins?
How to override dml statements with triggers?
What does indexation mean?
What security features are available for stored procedure?
Difference between aggregate functions of sql?
What are data resources?
Why use triggers?
what are the different ways to return the rowcount of a table?
What are the pre-defined functions in the sql server?
Why we need to use secondry database file? though, we can do same work using primary database file also.