交叉表 存储过程 实例

时间:2012-07-30 10:35:12
【文件属性】:

文件名称:交叉表 存储过程 实例

文件大小:5KB

文件格式:CS

更新时间:2012-07-30 10:35:12

交叉表 存储过程

其中代码:SELECT CONVERT(nvarchar, e.bmdwdm) AS '报名单位代码', a.bmdwmc AS '报名单位', SUM(CASE e.khmkdm WHEN '01' THEN e.kkk ELSE 0 END) AS '汉字录入', SUM(CASE e.khmkdm WHEN '02' THEN e.kkk ELSE '' END) AS '基础知识', SUM(CASE e.khmkdm WHEN '03' THEN e.kkk ELSE '' END) AS '程序设计', SUM(CASE e.khmkdm WHEN '04' THEN e.kkk ELSE '' END) AS 'CAD', SUM(CASE e.khmkdm WHEN '05' THEN e.kkk ELSE '' END) AS '网页制作', SUM(CASE e.khmkdm WHEN '06' THEN e.kkk ELSE '' END) AS '多煤体', SUM(CASE e.bmdwdm WHEN e.bmdwdm THEN e.kkk ELSE 0 END) AS '合计' FROM (SELECT bmdwdm, khmkdm, COUNT(bmdwdm) AS kkk FROM tblkaosheng AS d GROUP BY bmdwdm, khmkdm) AS e INNER JOIN tblbmdw AS a ON a.bmdwdm = e.bmdwdm GROUP BY e.bmdwdm, a.bmdwmc


网友评论