Do you mean like this:
CODE
SELECT a.title, a.name FROM lecturers a
INNER JOIN units b ON a.staff_no = b.staff_no
INNER JOIN exams c ON b.unit_code = c.unit_code
INNER JOIN students d ON c.stu_no = d.stu_no
WHERE d.degree = 'M402'
GROUP BY title
HAVING COUNT(*) >=3;
Because the output dosn't look right? It always has one result (the same one) no matter how low I take the number 3.
I guess I should post another problem I'm having since it's a similar problem. For each room I'm meant to show all the students who have at least 4 classes in that room. My query looks like:
CODE
SELECT r.room_no, s.name FROM student s , room r
WHERE stu_no IN
(SELECT stu_no FROM student)
HAVING COUNT(*) >=4;
But I don't think it's right. HELP!
This post has been edited by skin__: 6 Oct, 2008 - 10:34 PM