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
Can we call future method from trigger?
What are the characteristics of modern DBMS?
How do we Backup SQL Azure Data?
Some queries related to SQL
What is the data tier application?
Explain transaction server isolation?
Do you know what are pages and extents? : SQL Server Architecture
What is the purpose of floor function?
Which table keeps information about stored procedures?
Can you explain what are commit and rollback in sql?
What is the size of transaction log file?
What is the rdl file?
What are cursors? Explain the different types of cursors Enlist a few disadvantages of cursors.
Can we delete data from a view?
How to create stored procedures with parameters in ms sql server?