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
your distribution database is full what will u do
What is the main difference between ‘between’ and ‘in’ condition operators?
How to get a list of columns using the "sys.columns" view in ms sql server?
What is Command line parameters in PLSQL.?
Is the log file is a part of file group?
what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration
Which tcp/ip port does sql server run on? How can it be changed?
what are acid properties? : Sql server database administration
Describe the functionalities that views support.
What are three major types of constraints?
What does dml stand for?
Which trace flags are enabled in sql server?
what protocol both networks use? : Sql server database administration
What is difference between materialized view and view?
Explain the collation?