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
What can be used instead of trigger?
How you trouble shoot when any job fails
What are indexes in sql?
What are the different types of triggers in SQL SERVER?
What is the security principal at the database level that represents your session?
How to get a list of columns in a view using the "sp_columns" stored procedure?
How you can find out if an index is useful to the optimizer?
How adventureworkslt tables are related?
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
When we should use @@error?
Explain “@@rowcount” and “@@error” in sql server?
What do you mean by data manipulation language?
How to enter comments in transact-sql statements?
Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
Explain sql delete command?