有以下sql:SELECT YEAR(xmxxbswcsj) YEAR, COUNT(CASE WHEN xmfl LIKE '2,%' THEN 1 END) AS "房屋建筑sl", sum(CASE WHEN xmfl LIKE '2,%' THEN ztz END) AS "房屋建筑ztz", COUNT(CASE WHEN xmfl LIKE '8,%' THEN 1 END) AS "水务和海洋sl", sum(CASE WHEN xmfl LIKE '8,%' THEN ztz END) AS "水务和海洋ztz", COUNT(CASE WHEN xmfl LIKE '7,%' THEN 1 END) AS "市政基础设施sl", sum(CASE WHEN xmfl LIKE '7,%' THEN ztz END) AS "市政基础设施ztz", COUNT(CASE WHEN xmfl LIKE '4,%' THEN 1 END) AS "交通工程sl", sum(CASE WHEN xmfl LIKE '4,%' THEN ztz END) AS "交通工程ztz", COUNT(CASE WHEN xmfl LIKE '11,%' THEN 1 END) AS "园林绿化sl", sum(CASE WHEN xmfl LIKE '11,%' THEN ztz END) AS "园林绿化ztz", COUNT(CASE WHEN xmfl LIKE '6,%' THEN 1 END) AS "其他新改扩sl", sum(CASE WHEN xmfl LIKE '6,%' THEN ztz END) AS "其他新改扩ztz" FROM "MH-JSGCZTB".biz_Project_base where status='1' GROUP BY YEAR(xmxxbswcsj) order by YEAR(xmxxbswcsj) DESC;如何统计xmfl LIKE '2,%'和xmfl LIKE '11,%'的和
理解问题有以下sql:SELECT YEAR(xmxxbswcsj) YEAR, COUNT(CASE WHEN xmfl LIKE '2,%' THEN 1 END) AS "房屋建筑sl", sum(CASE WHEN xmfl LIKE '2,%' THEN ztz END) AS "房屋建筑ztz", COUNT(CASE WHEN xmfl LIKE '8,%' THEN 1 END) AS "水务和海洋sl", sum(CASE WHEN xmfl LIKE '8,%' THEN ztz END) AS "水务和海洋ztz", COUNT(CASE WHEN xmfl LIKE '7,%' THEN 1 END) AS "市政基础设施sl", sum(CASE WHEN xmfl LIKE '7,%' THEN ztz END) AS "市政基础设施ztz", COUNT(CASE WHEN xmfl LIKE '4,%' THEN 1 END) AS "交通工程sl", sum(CASE WHEN xmfl LIKE '4,%' THEN ztz END) AS "交通工程ztz", COUNT(CASE WHEN xmfl LIKE '11,%' THEN 1 END) AS "园林绿化sl", sum(CASE WHEN xmfl LIKE '11,%' THEN ztz END) AS "园林绿化ztz", COUNT(CASE WHEN xmfl LIKE '6,%' THEN 1 END) AS "其他新改扩sl", sum(CASE WHEN xmfl LIKE '6,%' THEN ztz END) AS "其他新改扩ztz" FROM "MH-JSGCZTB".biz_Project_base where status='1' GROUP BY YEAR(xmxxbswcsj) order by YEAR(xmxxbswcsj) DESC;如何统计xmfl LIKE '2,%'和xmfl LIKE '11,%'的和
已完成理解「有以下sql:SELECT YEAR(xmxxbswcsj) YEAR, COUNT(CASE WHEN xmfl LIKE '2,%' THEN 1 END) AS "房屋建筑sl", sum(CASE WHEN xmfl LIKE '2,%' THEN ztz END) AS "房屋建筑ztz", COUNT(CASE WHEN xmfl LIKE '8,%' THEN 1 END) AS "水务和海洋sl", sum(CASE WHEN xmfl LIKE '8,%' THEN ztz END) AS "水务和海洋ztz", COUNT(CASE WHEN xmfl LIKE '7,%' THEN 1 END) AS "市政基础设施sl", sum(CASE WHEN xmfl LIKE '7,%' THEN ztz END) AS "市政基础设施ztz", COUNT(CASE WHEN xmfl LIKE '4,%' THEN 1 END) AS "交通工程sl", sum(CASE WHEN xmfl LIKE '4,%' THEN ztz END) AS "交通工程ztz", COUNT(CASE WHEN xmfl LIKE '11,%' THEN 1 END) AS "园林绿化sl", sum(CASE WHEN xmfl LIKE '11,%' THEN ztz END) AS "园林绿化ztz", COUNT(CASE WHEN xmfl LIKE '6,%' THEN 1 END) AS "其他新改扩sl", sum(CASE WHEN xmfl LIKE '6,%' THEN ztz END) AS "其他新改扩ztz" FROM "MH-JSGCZTB".biz_Project_base where status='1' GROUP BY YEAR(xmxxbswcsj) order by YEAR(xmxxbswcsj) DESC;如何统计xmfl LIKE '2,%'和xmfl LIKE '11,%'的和」
展开阅读网页