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

How to insert multiple rows with one insert statement in ms sql server?

582


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

498


Can sql servers linked to other servers like oracle?

536


Do you know the policy based administration feature of sql server 2008?

567


Why I have to use stored procedures?

586






What is indexed view?

588


What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?

475


as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration

484


Is null vs coalesce?

497


What are various ways to enhance the ssrs report?

522


Describe how to use linked server?

535


Define Unique Key?

588


Explain what are the events recorded in a transaction log?

544


What are filegroups in sql server?

573


What are cursors? Explain the different types of cursors Enlist a few disadvantages of cursors.

610