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 is the benefit of normalization?

596


What are the essential components of sql server service broker?

569


What are triggers? How do you invoke a trigger on demand?

752


How to create a view on an existing table in ms sql server?

595


What is an index. What are the types?

587






What is replace and stuff function in sql server?

567


How to select some specific rows from a table in ms sql server?

574


What is autocommit mode in sql server?

549


What is an sql server agent?

551


Can sql servers link to other servers like oracle?

474


What are the benefits of filtered indexes?

515


what kind of lan types do you know? : Sql server database administration

520


How do I install sql server?

472


how do you determine the Load performance of any query in sql server {example how do u determine performance of a select stmnt which returns Dynamically many no of records ... some times 100,1000,10000 etc., }

1857


What are the diifferences between the ms sql server vs mysql?

659