Delete duplicate records from the table?(Table must have
unique id)

Answer Posted / lince

DELETE
FROM MyTable
WHERE ID IN
(
SELECT MAX(ID)
FROM MyTable
GROUP BY DuplicateColumn1 HAVING COUNT(ID)>1
)

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a self join? : Sql server database administration

686


Why use “pivot” in sql server?

774


What is cross join in sql server joins?

793


Explain what are various ways to enhance the ssrs report?

776


How to create a scrollable cursor with the scroll option?

667






How to defragment table indexes?

697


Tell me what do you mean by an execution plan? Why is it used? How would you view it?

663


Which are the third-party tools used in sql server and why would you use them?

651


How to create a view with data from multiple tables?

767


How to remove duplicate rows from table except one?

739


What is SQL Azure Federations?

106


What is unpivot?

775


OPTIMIZATION OF SP,CURSOR,TRIGGERS

2378


can an automatic recovery be initiated by a user? : Sql server administration

704


What does asynchronous call backs means?

766