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
How do you clear a log file?
What is the use of sign function?
What stored by the model? : sql server database administration
What are joins in sql and what are the different types of joins?
write an SQL query to list the employees who joined in the month of January?
How can you start sql server in different modes?
How to declare a cursor with "declare ... Cursor" in ms sql server?
What is trace flag in sql server?
Can binary strings be used in arithmetical operations?
What is an execution plan? How would you view the execution plan?
what's new in sql server 2016?
What is the log shipping?
Which are the third-party tools used in sql server and why would you use them?
What are the tool windows in sql server management studio? : sql server management studio
What are the new features in SQL Server 2005 when compared to SQL Server 2000?