用一条SQL语句查出每门课程分数都大于80分的学生姓名:
//语句1:
select a.name
from
(select name ,count(*) as ren from tablename group by name) a,
(select name ,count(*) as fen from tablename where fenshu>80 group by name) b
where a.name=b.name and a.ren=b.fen ;
//语句2
select distinct name from tablename where name not in (select distinct name from tablename where fenshu<80);
//语句3
select distinct name from tablename where fenshu>80 and name not in (select name from tablename where fenshu<80);