我有两张 table :-
学生表
std_ID|std_Name
------+--------
1 | Jhon
2 | Peter
3 | Mic
4 | James
学生批处理表
B_std_ID|B_Batch_ID
--------+-------------
1 | 3
2 | 6
3 | 7
我想要那些没有被批量录取的学生, 我想要这个
std_ID|std_Name
------+--------
4 | James
我尝试了这段代码
SELECT std_ID, std_Name FROM student , studentBatch WHERE std_ID <> B_std_ID;
但是没有成功,请帮我解决
最佳答案
select std_id
from student
where std_id not in (select B_std_ID from studentbatch)
关于mysql - SQL,选择不等于的地方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24368191/