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

what is single byte over head in oracle..?

1872


what is the difference between a having clause and a where clause? : Sql dba

522


Is sql the best database?

503


What is indexing in sql and its types?

547


Does truncate require commit?

547






What are all the different normalizations?

591


Are stored procedures faster than queries?

524


Write a unique difference between a function and a stored procedure.

535


What is a pragma statement?

723


What is parallel hint?

750


Is like operator in sql case sensitive?

511


What is union, minus and interact commands?

750


What is user in sql?

585


How many types of functions are there in sql?

509


How to select 10 records from a table?

651