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
What is ems sql management studio? : sql server management studio
What is sql service broker?
how can you attach more than 20 ldf files in sql server
What is molap and its advantage? : sql server analysis services, ssas
How to drop an existing table with "drop table" statements in ms sql server?
Scalability, Availability, Integration with internet, etc.)?
What is NOT NULL Constraint in sql server 2012?
What is the difference between cartesian product and cross join?
What is the significance of master, tempdb and model databases?
How to verify the port number of the sql server?
What is sql azure database?
Explain the dirty pages?
What is a partition key?
What is partition in sql server?
Explain what is the main purpose of having conversation group?