有一张student_info表 请用sql查询所有课程成绩大于80的学生姓名
name | class | score |
---|
张三 | 语文 | 70 |
张三 | 数学 | 82 |
李四 | 语文 | 90 |
李四 | 数学 | 60 |
王五 | 语文 | 92 |
王五 | 数学 | 89 |
王五 | 英语 | 90 |
sql: select name from student_info where name not in (select distinct name from student_info where soccer <80 )
思路: 先找出 不符合条件的名字 然后再 not in。