how to retrieve only duplicate values in a table

Answer Posted / sri

For example,u have a table called student like below.

STUD-NAME SUBJECT
--------- ------
STUD1 A
STUD2 B
STUD2 A
STUD1 A

in this structure 1 row is duplicated in 4 th. so we can
fetch the student name using the below qry.

SELECT stud-name FROM STUDENT
GROUP BY stud-name,subject
HAVING COUNT > 1.

Is This Answer Correct ?    12 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sql a scripting language?

524


What is nested table in pl sql?

555


Explain ddl statements in pl/sql?

580


i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5

3214


What are the two different parts of the pl/sql packages?

568






what is a composite key ? : Sql dba

612


What are stored procedures in mysql?

569


what is sql in mysql? : Sql dba

572


What are string functions in sql?

678


What are character functions in sql?

500


Does truncate remove indexes?

563


List and explain the different types of join clauses supported in ansi-standard sql?

827


What is sqlca in powerbuilder?

574


What is the usage of when clause in trigger?

571


How to take user input in pl sql?

705