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
Is sql server difficult to learn?
I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration
What does nvl stand for?
How to use order by with union operators in ms sql server?
Define full outer join in sql server joins?
Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?
Define right outer join?
What are different types of collation sensitivity?
How to use subqueries with the in operators in ms sql server?
How to create a scrollable cursor with the scroll option?
What is transaction server auto commit?
If any stored procedure is encrypted, then can we see its definition in activity monitor?
Explain multiserver query
how to use DTS package in 2000,2005,2008 in sql server
How can I create a report based on a query? : sql server management studio