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
How to replace given values with null using nullif()?
what is a sub-report?
What do you mean by an execution plan? How would you view it?
Can two tables share the same primary key?
Which are the two editions in which SQL Azure database available?
How do you create a data source?
Explain about system database?
How many types of relations are there between dimension and measure group? : sql server analysis services, ssas
How to drop an existing stored procedure in ms sql server?
The external application that is executed in one of the tasks does not have a log file, but only a screen log. How can I save the data from the screen? : sql server management studio
How to download and install microsoft .net framework version 2.0?
What are entities and relationships?
Can a database be shrunk with users active?
Give main differences between "Truncate" and "Delete".
What happens if null values are involved in comparison operations?