34,593
社区成员
发帖
与我相关
我的任务
分享
select
正班长姓名=b.stu_name,
副班长姓名=c.stu_name
from
class a,student b ,student c
where
a.monitor_id=b.stu_id
and
a.vince_monitor_id=c.stu_id
select [id]=monitor_id,stu_name from student s,class c where c.monitor_id=s.stu_id
union all
select [id]=vince_monitor_id,stu_name from student s,class c where c.vince_monitor_id=s.stu_id
select
正班长姓名=b.stu_name,
副班长姓名=c.stu_name
from class a
join student b on a.monitor_id=b.stu_id
join student c on a.vince_monitor_id=c.stu_id
select 正班长姓名=b.stu_name,副班长姓名=c.stu_name
from class a
left join student b on a.monitor_id=b.stu_id
left join student c on a.vince_monitor_id=c.stu_id