if 3 duplicate records in a table,i want to delete 2 duplicate
records by keeping 1 duplicate and 1 original as it is,how?

Answer Posted / amol maske

DELETE FROM tablename WHERE ROWID NOT IN(
SELECT MIN(ROWID)FROM tablename GROUP BY columnname);

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are the basic functions for master, msdb, model, tempdb databases?

757


What are the different editions available in sql server 2000?

810


How to handle error or exception in sql?

752


What are the types of joins in sql?

862


How to convert a table data in XML format in sql server?

2343


Explain the steps to use transact-sql cursor?

702


What do you understand by user-defined function in the sql server?

758


What is database mirroring?

827


How to start sql server browser service?

850


Explain transaction isolation levels in sql server?

814


What is the usage of the sign function?

764


What is query optimization process?

767


Explain different types of lock modes in sql server 2000?

746


How can we determine what objects a user-defined function depends upon?

750


After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas

775