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

What are database states in ms sql server?

831


Tell me the use of keyword with encryption. Create a store procedure with encryption?

750


Can you explain powershell included in sql server 2008?

669


What is Federation and Federation Member?

90


What is unique key constraint?

807






Why would you call update statistics?

755


What is 2nf normalization form?

776


How to update muliple row in single query?

798


What is a covering index?

721


How to execute a sql statement using mssql_query()?

713


What is hot add cpu in sql server 2008?

699


What is the architecture of ms sql reporting service?

702


How we can compare two database data?

686


Explain trigger classes i.e. Instead of and after trigger?

639


What is the return type of executeupdate ()?

691