SELECT abnamecname as course_name FROM curricula_variable as a join student as b on astudent_id=bid join course as c on acourse_id=cid where astudent_id=$studentId order by aid asc limit $page4中的abc的意
a代表curricula_variable表的别名,b代表student表的别名,c代表course表的别名。
b.name表示从student表中获取学生姓名,c.name表示从course表中获取课程名称。
其中,a.*,b.name,c.name as course_name表示从curricula_variable表中获取所有字段,从student表中获取姓名字段,从course表中获取名称字段并将其命名为course_name。
{$studentId}和{$page}是变量,表示传入的学生ID和分页页码。
原文地址: https://www.cveoy.top/t/topic/hwFx 著作权归作者所有。请勿转载和采集!