For example – Table name = TABLE
StudentID | SubCode | SubName
-----------------------------
1 M1 Math
1 S1 Science
1 E1 English
2 H1 History
3 G2 Geography
4 M1 Math
Can we display the answer like this ?
studentid | SubCode | SubName
---------------------------------
1 M1 Math
1 S1 Science
1 E1 English
An
IN()subquery with aHAVINGclause should do it: