一个公司组织运动会,要求统计报名信息。
建三张表。
1.
Code

列出报名最多的那个项目的人员列表
sql:
Code
2.统计每项报名人数
sql:
select a.name,c.humannum from sportitem a,

(
select  b.item bitem,count(
b.employee
) humanNum 
from 
empchooseitem b
group by b.item  ) c
where a.id=c.bitem

posted on 2009-09-22 21:12  netfuns  阅读(195)  评论(0)    收藏  举报