是的,大佬,数据透视表不能够存到另一张数据表哦,表的结构不一样,大佬可以通过写视图代码来实现呢~
这边提供个思路:
使用SUM和CASE对金额按照分类进行汇总统计
SUM(CASE WHEN [fl] = 'A' THEN [jq] ELSE 0 END) AS A,
SUM(CASE WHEN [fl] = 'B' THEN [jq] ELSE 0 END) AS B,
SUM(CASE WHEN [fl] = 'C' THEN [jq] ELSE 0 END) AS C,
SUM(CASE WHEN [fl] = 'D' THEN [jq] ELSE 0 END) AS D
大佬可以参考一下哈~~~ |