I have to find a result based on the following tables
Students
StudentPapersSelection as sps
StudentGroupManagegemt as sgm
Internal Data as iars
From student I need students rollno and name where iars’s paperid = sps’s paperid and iars groupid= sgm group id and students id should be based on the previous two things.
The query I am running is:
select students.rollno, students.name
from students,sps,iars,sgm
where iars.id=1
and students.studentid=(select studentid
from sps where sps.paperid=iars.paperid
and iars.id=1)
and students.studentid=(select studentid
from sgm
where sgm.groupid=iars.groupid
and iars.id=1)
and students.course=iars.courseid
and students.semester=iars.semester
It says query returning more than 1 rows. I hate this problem.
I’ll try I guess:
Assuming tables like this:
And data like this: