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 record in oracle pl sql?

508


What does (+) mean in sql joins?

503


What is native sql query?

528


Is sql database free?

504


Can we delete column in sql?

536






what are the join types in tsql? : Transact sql

555


Is ms sql is free?

512


how many sql dml commands are supported by 'mysql'? : Sql dba

544


what is the different between now() and current_date()? : Sql dba

500


What is sql deadlock?

548


Can we use ddl statements in stored procedure?

670


What is the difference between clustered and non-clustered indexes?

578


Which is better stored procedure or query?

520


How delete a row in sql?

517


Which are sql * plus commands?

514