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

what is commit? : Sql dba

619


column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.

6088


What is primary key sql?

546


Which software is used for pl sql programming?

526


what are the different functions in sorting an array? : Sql dba

584






What is the difference between subquery and correlated query?

533


how to get @@error and @@rowcount at the same time? : Sql dba

531


Can I create table without primary key?

533


What is the difference between Union and Union all. Which is faster.

846


Mention what does the hierarchical profiler does?

565


What is data control language?

532


How do you update a value in sql?

549


Which normal form is best?

517


What are dml commands?

531


Is join an inner join?

538