看似简单,但其实包含很多技巧思维
1.查询课程表中所有科目大于80的学生
select distinct name from student where name not in (select name from student where grade<80);
这样是错误的
select distinct name from student where name in (select name from student where grade>=80);这样代表只要有一门大于80即可
时间: 2020-09-16|20次围观|0 条评论
看似简单,但其实包含很多技巧思维
1.查询课程表中所有科目大于80的学生
select distinct name from student where name not in (select name from student where grade<80);
这样是错误的
select distinct name from student where name in (select name from student where grade>=80);这样代表只要有一门大于80即可
原著是一个有趣的人,若有侵权,请通知删除
还没有人抢沙发呢~