标签:
-------------------对分组统计的结果进一步筛选(having子句使用)------------------------------ select * from student2010 --1、查询qypt08class表中各院系的人数,只显示人数多于400的记录 select yx,sum(rs) from qypt08class group by yx having sum(rs)>400 --2、统计stucou表中各门课程的选修人数,只显示人数少于30的记录(显示couno及对应的人数) select couno,count(*) from stucou group by couno having count(*)<30 --3、查询student2010表中人数多于70人的班级的xymc、zymc、bjmc及rs(人数) select xymc,zymc,bjmc,count(*) from student2010 group by xymc,zymc,bjmc having count(*)>70
标签:
原文地址:http://www.cnblogs.com/tcheng/p/5959073.html