有三张表联合查询

[复制链接]
查看11 | 回复1 | 2012-12-28 08:58:27 | 显示全部楼层 |阅读模式
1.select t3.部门名称,t2.人数 from (select t1.deptcode,count(t1.humancode) as 人数 from 员工表 t1 where humancode in (select humancode from 考核表 wherekpicode='合格') group by t1.deptcode) t2,部门表 t3where t2.deptcode=t3.deptcode2. select kpicode,count(*)as 人数 from 考核表 group by kpicode3.selectt3.deptname,t4.kpicode,t4.人数 from 部门...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行