1.
select * from student t1,(select top 3 score from student group by score order by score desc)t2
where t1.score=t2.score
2.
select class
from student
group by class
having sum(case sex when 'f' then 1 else 0 end)=sum(case sex when 'm' then 1 else 0 end)
1、学习,原来TOP还可以这么用,:)
2、我猜的,估计不行,:):
select a.class from student a,student b
where (a.class=b.class) and (count(a.name)=count(b.name))
and (a.sex="m" and b.sex="f")