2013-10-08 101 views

回答

0

調整以適合您的WHERE子句,特定數據庫和JOIN需求。

對於學生的課程:

SELECT * 
FROM student_info JOIN class_student ON student_info.student_id = class_student.student_id 
        JOIN class_info ON class_student.class_id = class_info.class_id 
WHERE student_info.student_id = ... 

對於一類的學生:

SELECT * 
FROM class_info JOIN class_student ON class_info.class_id  = class_student.class_id 
       JOIN student_info ON class_student.student_id = student_info.student_id 
WHERE class_info.class_id = ...