标签:mysql ima 分享图片 case count when ase account group
1、原始表
2、查询结果表
3、查询语句
1 SELECT
2 year1,
3 SUM( CASE WHEN mon= 1 THEN account END ) AS m1,
4 SUM( CASE WHEN mon= 2 THEN account END ) AS m2,
5 SUM( CASE WHEN mon = 3 THEN account END ) AS m3,
6 SUM( CASE WHEN mon = 4 THEN account END ) AS m4 FROM
8 dt
9 GROUP BY year1;
标签:mysql ima 分享图片 case count when ase account group
原文地址:https://www.cnblogs.com/enthos/p/10301982.html