how to retrieve only duplicate values in a table

Answer Posted / kirankumar.vangeti

For the same example given in the answer 1

select studentname, subject, count(studentname) as count
from student
group by studentname, subject
having (count(studentname)>1);

above query will give the results like

STUD1 A 2

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many groups of data types? : Sql dba

544


Why is nosql good?

566


What are the types of variables use in pl sql?

479


What is a native sql query?

476


What is the use of index in hive?

523






What is multiple partition?

521


What are the set operators in sql?

532


How can we optimize a sql query?

551


who introduced sql?

547


What is natural join in sql?

510


What is the difference between microsoft access and sql server?

509


Is delete faster than truncate?

524


Which column of the user triggers data dictionary view displays the database event that will fire the trigger?

573


What is the use of & in pl sql?

515


Why do we use function in pl sql?

532