复制
收藏
提问
全网

有以下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,%'的和

ea47b8ae6
2个月前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题有以下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,%'的和
不在提醒

更专业内容正在努力生成中
知识树
有以下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查询性能?
SQL查询中如何使用索引?
数据库设计的基本原则是什么?

以上内容由AI搜集生成,仅供参考

在线客服