table:student
id name grade course
1 zhangsan 75 marth
2 lisi 80 chinese
3 zhangsan 69 chinese 要求查询出成绩低于70分的学生名字?
id name grade course
1 zhangsan 75 marth
2 lisi 80 chinese
3 zhangsan 69 chinese 要求查询出成绩低于70分的学生名字?
select name from student where grade <70
我想说用not exists子查询的。
为什么一定要用not exists?
(select 1 from student t2 where grade >70 AND t1.ID=t2.ID);
其实跟NO IN 差不多啊!
where not exists(select 1 from student where a.id=id and grade<70)select * from student
where grade<70
谢谢!!
汗~~