student表
id name
1 张三
2 李四
3 王五
4 赵四
result表
id score
1 80
2 60
查询没有考试成绩的学生
方法1:
select * from student where id not in (select id from result)
方法2:
select * from student where not exists (select 1 from result where result.id= student.id )
方法3:
select student.* from student left join result on (studeng.id = result.id) where result.id is null
本文将介绍如何使用SQL语句查询学生表中未出现在考试成绩表的学生信息,通过三种方法实现这一目标,包括使用IN子查询、EXISTS谓词以及LEFT JOIN操作。
2834

被折叠的 条评论
为什么被折叠?



