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 are constraints? Explain different types of constraints? : Sql server database administration
What is the process of indexing?
Write the syntax for stuff function in an sql server?
Why do you want to join software field as you have done your BE in Electronics?
How to create a dynamic cursor with the dynamic option?
Can we add our custom code in ssis?
what are the disadvantages of cursors? : Sql server database administration
What is tempdb in sql server?
What is bookmark link in ssrs?
how would you troubleshoot blocking? : Sql server database administration
What are subqueries in sql server?
Explain the properties of sub-query in sql server?
What is proper subset of candidate key?
How do I know if localdb is running?
What are the new features in SQL Server 2005 when compared to SQL Server 2000?