How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / anoop rajan
Tbale emp had some duplicate entries and i wanted to retain
the first of all duplicates, the others could be deleted as
follows . Please give your comments if this is the most
optimum way :
delete from emp where rowid in
(select rowid from emp o where rowid !=
(select min(rowid) from emp i where i.empno=o.empno));
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?
What is the fastest way to permanently delete a 1 million row table named customers?
What is enhanced database mirroring in sql server 2008?
System requirements for sql server 2005 express edition?
What is Federation and Federation Member?
hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.
Explain transaction server auto commit?
What are the components of sql server service broker?
What is the difference between a unique key and primary key?
Why are you getting errors when creating a new odbc dsn?
How do database indexes work?
User wants only to display only pdf as export option in report manager. How to achieve this?
What is the difference between inner join and equi join?
Explain different types of lock modes in sql server 2000?
Why should you use or avoid select * statements?