1。表:老师
Id_Users ID_Teacher Fname Lname
---------------------------------------------
1 abc Jhon Smith
2 abb MIx Gordon
3 aba Jim Tomson
2。表格:学生
Id_Users ID_Student Fname Lname --------------------------------------------- 4 xyz Anderson baker 5 zxc Emily Smoke 6 cvx Anny Jane
3。表格:Inteam
Id_Inteam ID_Users(FK) ID_Team ID_Activities -------------------------------------------------------- 1 1 1 11 2 3 2 12 3 4 1 11
我需要让老师和学生在表In_Team和ID_Activities中不存在的位置!= 11我如何创建查询。请帮助
select t.Id_Users
, t.ID_Teacher
, t.Fname
, t.Lname
, u.Fname
, u.Lname
from Teacher t
inner join
left join In_Team i ON i.id_users = t.id_users
ID_Activities != 11
where i.id_users is null