SQL方法:
- SELECT 绩效考核班组,[绩效考核-岗位类别系数],SUM(考勤奖考勤人数) AS 考勤奖考勤人数,SUM([考勤奖下拨额度(]) AS 考勤奖下拨额度,SUM(绩效奖考勤人数) AS 绩效奖考勤人数,SUM(绩效奖下拨额度) AS 绩效奖下拨额度 FROM
- (SELECT 绩效考核班组,[绩效考核-岗位类别系数],考勤人数 AS 考勤奖考勤人数,[考勤奖下拨额度(],0 AS 绩效奖考勤人数,0 AS 绩效奖下拨额度 FROM [原2个表$D6:J29]
- UNION ALL
- SELECT 绩效考核班组,[绩效考核-岗位类别系数],0 AS 考勤奖考勤人数,0 AS [考勤奖下拨额度(],考勤人数 AS 绩效奖考勤人数,绩效奖下拨额度 FROM [原2个表$F6:R28])
- GROUP BY 绩效考核班组,[绩效考核-岗位类别系数]
- ORDER BY 绩效考核班组,[绩效考核-岗位类别系数]
- UNION ALL
- SELECT '总计' AS 绩效考核班组,"" AS [绩效考核-岗位类别系数],SUM(考勤奖考勤人数) AS 考勤奖考勤人数,SUM([考勤奖下拨额度(]) AS 考勤奖下拨额度,SUM(绩效奖考勤人数) AS 绩效奖考勤人数,SUM(绩效奖下拨额度) AS 绩效奖下拨额度 FROM
- (SELECT 绩效考核班组,[绩效考核-岗位类别系数],考勤人数 AS 考勤奖考勤人数,[考勤奖下拨额度(],0 AS 绩效奖考勤人数,0 AS 绩效奖下拨额度 FROM [原2个表$D6:J29]
- UNION ALL
- SELECT 绩效考核班组,[绩效考核-岗位类别系数],0 AS 考勤奖考勤人数,0 AS [考勤奖下拨额度(],考勤人数 AS 绩效奖考勤人数,绩效奖下拨额度 FROM [原2个表$F6:R28])
复制代码
|