用一條SQL語句查詢出T_score表中每門課都大於80分的學生姓名
name | course | score |
張三 | 語文 | 81 |
張三 | 數學 | 80 |
李四 | 語文 | 76 |
李四 | 數學 | 90 |
李四 | 英語 | 75 |
select name from T_score group by name having min(score) >80;
或者:
select distinct name from T_score where name not in (select distinct name from T_score where score <= 80);