0

My SQL query is:
UPDATE REGISTRUDENT set qual=1 WHERE studentolevelsubjects AS sls INNER JOIN courserequirements AS csreq ON sls.subject_id = csreq.subject_id WHERE sls.stud_id = '$stud_id' AND sls.grade_id>=csreq.min_grade AND sls.examno = '$examno' AND csreq.course_id = '$course_id'

I'm having issue comparing two different table to get if a registrant qualified based on the course requirement I need help

course requirement table
shot1.jpg

The subject passed by the student in exams
shot2.jpg

I intend updating and setting the qual =1 if the student qualifies

Many Thanks

1
Contributor
1
Reply
17
Views
8 Months
Discussion Span
Last Post by Nollyvenon
0

this is an updated query:
UPDATE REGISTRUDENT rs
JOIN studentolevelsubjects sls ON sls.some_column = rs.some_column //missing this JOIN
JOIN courserequirements csreq ON sls.subject_id = csreq.subject_id
AND sls.grade_id >= csreq.min_grade
WHERE sls.stud_id = '$stud_id'
AND sls.examno = '$examno'
AND csreq.course_id = '$course_id'
SET rs.qual = 1;
but I want the query to ensure the student meets all the subjects requirement before update

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.