how to delete duplicate rows in sql server2005

Answer Posted / enis ertem

with DeleteDups as
(
Select * from TableA AS T1
where KeyCol <
(Select Max(Keycol) from TableA as T2
where t1.Id = T2.ID)
)

Delete from Delete Dups;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?

574


What is collation?

715


Can sql servers linked to other servers like oracle?

547


What is the openxml statement in sql server?

538


What triggers long term care?

564






How to manipulate data from one table to another table ?

548


Is it true that rules do not apply to data already existing in a database at the time the rule is created?

563


What is the bookmark lookup and rid lookup?

578


What is the difference between lock, block and deadlock? : sql server database administration

567


What are the reporting services components?

92


What is a filestream?

558


Give me a SQL Query to find out the second largest company?

694


What are approximate numeric data types in ms sql server?

591


Explain can you implement data mining in ssrs?

106


Can you explain various data region available in ssrs with their use?

548