本文介绍了表逻辑过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有这三张桌子。 主管 SupervisorStudent SupID -------> PK SupID ------> FK SupID ------->PK SupID ------>FK StuID -------> FK StuID ------->FK 学生 StuID -------> PK StuID ------->PK 通过这种方式,我可以证明学生与哪位主管并列。This way i could show the students were tied under which supervisor.然而,问题是我无法向主管展示没有学生。however, there problem is i could not show the supervisor that do not have student.推荐答案 用sql语句就像这样 选择sup.supid 来自Supervisor sup left outer join SupervisorStudent link on sup.supid = link.supid link.stuID是null 我正在做一个左外连接,保证我选择所有的主管...然后我说学生id为空的地方......这意味着没有学生with a sql statement it would be like thisselect sup.supidfrom Supervisor sup left outer join SupervisorStudent link on sup.supid = link.supid where link.stuID is nulli'm doing a left outer join which guarantees i select all supervisors ... and then i say where the student id is null ... which means there are no students 这篇关于表逻辑过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-11 18:02