How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?

Answer Posted / madhur/amrutha

Consider a table emp with employee details. The Correct
code to retrieve duplicate rows :


select distinct * from emp where names in
(select names from emp group by names having count(sal)>1)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are indexers?

718


What is application role in sql server database security? : sql server security

656


What do you mean by a dependent functionality in a build?

747


System requirements for sql server 2005 express edition?

636


Different types of keys in SQL?

727






What are various aggregate functions that are available?

589


Scalability, Availability, Integration with internet, etc.)?

2514


How do I create an extended event in sql server?

572


What are information schema views?

648


What are window functions in sql server?

595


Which sql server is best?

610


What are parameterized reports? What are cascading parameters in ssrs reports?

110


What are clustered and non-clustered index?

633


Which command is used for user defined error messages?

648


What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?

691