SQL语句学习

看似简单,但其实包含很多技巧思维

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即可

  

 

posted @ 2015-04-17 17:20  晋心  阅读(166)  评论(0编辑  收藏  举报