Riddhi Valecha

Riddhi Valecha

  • 440
  • 3.3k
  • 414.7k

SQL Query- 1 student for distinct Exams.

Aug 8 2014 8:15 AM
Hi all...

I need help in forming a SQL Query.

I have the following table -

ID
Student
Exam
1
A
MAT
2
A
MAT
3
A
CAT
4
B
CAT
5
B
CAT
6
C
MAT
7
C
MAT
8
C
CAT

Now, I want the following output as result -

ID
Student
Exam

1
A
MAT

2
A
CAT

3
B
CAT

4
C
MAT

5
C
CAT


1 Student have appeared for distinct 2 exams - MAT and CAT.

How do I do this??

PLease help.



Answers (7)