how to retrieve only duplicate values in a table

Answer Posted / ravi patel

for the table emp
ID NAME
1 ravi
2 umang
1 ravi
3 nishant

now fire the query as beleow

select * from emp group by id,name having count(id)>1 and
count(name)>1;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a composite key be null?

534


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

560


How do I edit a trigger in sql developer?

549


What is the meaning of disabling a trigger?

655


How can you load multi line records? : aql loader

667






What is difference between primary and secondary key?

528


How do you know if a relationship is 2nf?

529


How to return multiple rows from the stored procedure?

528


How to connect a sql*plus session to an oracle server?

630


What are tuples in sql?

575


What is %type in sql?

525


Determine if oracle date is on a weekend?

566


How do I filter in sql profiler?

542


What does the base_object_type column shows in the user.triggers data dictionary view?

584


What does count (*) mean?

535