来高手无聊帮下忙。
表A
id name 工资 部门
1 aa 2000 开发
2 bb 3000 销售
3 cc 2000 开发
4 dd 5000 销售
5 ee 8000 技术
6 ff 3500 技术
实现成
部门 2000~4000 4001~6000 6001~8000
开发 2人 0人 0人
销售 1人 1人 0人
技术 0人 0人 2人
select 部门,
count(case when 工资 between 2000 and 4000 then 1 end)[2000~4000],
count(case when 工资 between 4001 and 6000 then 1 end)[4001~6000],
count(case when 工资 between 6001 and 8000 then 1 end)[6001~8000]
from # group by 部门
求一高手用 struts2+hibernate 做成 能在页面显示一下就行,刚学struts2 不知道怎么网页做获取值