how to retrieve only duplicate values in a table

Answer Posted / sixface

ID NAME
1 ravi
2 umang
1 ravi
3 nishant

SELECT id,name
FROM emp
WHERE id in
(
SELECT id
FROM emp
GROUP BY id
HAVING COUNT(*) > 1
);
It gives all duplicate rows........
Lets try.....

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between pl/sql and sql?

619


What is the maximum number of triggers, you can apply on a single table?

544


What is compilation error in pl sql?

505


Is left join faster than inner join?

619


What is type and rowtype in pl sql?

538






What are sql data types?

549


How exception is different from error?

545


what is data manipulation language? : Sql dba

531


what are the differences between require and include, include_once and require_once? : Sql dba

532


What is meant by temporal data?

546


what is column? : Sql dba

575


What is coalesce sql?

518


How do you break a loop in pl sql?

528


Explain what is dbms?

581


How to combine two stored procedures in sql?

594