sqlquery

Giganews Newsgroups
Subject: sqlquery
Posted by:  Mary Phelps (icanhelp…@gmail.com)
Date: Mon, 18 May 2015

I have a table student with following columns
StudentId  SemesterId  ExamYearId
1                1        1
1                2        2
1                3        3
3                1        1 =20
3                2        2
3                3        4=20
7                1        1
7                3        4=20
8                1        1
8                2        2=20
I want a query to get all such student for whom no data exists for semester=
id=3D3 and examyearid=3D3, however same student should have data for semest=
erid=3D2. In this case it should return me studentid=3D8 as studentid=3D8 h=
as data for semesterid=3D2 and examyearid=3D2 however no data for examyeari=
d=3D3 and semesterid=3D3. Basically I want to be able to input semesterid a=
nd examyearid and find which studentid's have not filled data for that seme=
sterid and examyearid.

Replies