How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / anil kumar karasi
1.
Select from <table name A>
where rowid > (select min(rowid) from <table name B>
where A.keyvalues=B.keyvalues);
2.
Delete from <table name A>
where rowid > (select min(rowid) from <table name B>
where A.keyvalues=B.keyvalues);
| Is This Answer Correct ? | 12 Yes | 9 No |
Post New Answer View All Answers
Explain about sql server login?
Can sql server 2016 run on windows 7?
What is built-in/administrator?
What is the difference between functions and scalar functions?
What is the simplest way to create a new database in ms sql server?
List out the difference between union and union all in sql server?
What is the full form of ddl?
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
How many types of triggers are there?
What is the command used to check locks in microsoft sql server?
How can I create a report based on a query? : sql server management studio
What is the difference between a clustered index and a non-clustered index?
How to Insert multiple rows with a single insert statement?
as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration
How do database indexes work?