以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  提示“全过程”和“工程决算“无效”  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=66002)

--  作者:jhq1989
--  发布时间:2015/3/27 11:48:00
--  提示“全过程”和“工程决算“无效”

怎么改 代码如下

s elect 工程类型,sum(case when 工程类型 = 全过程 then 1 else 0 end) as 全过程,sum(case when 工程类型 = 工程决算 then 1 else 0 end) as 工程决算
from 工程统计表
group by 工程类型


--  作者:有点甜
--  发布时间:2015/3/27 11:50:00
--  

 这两个是 列名 还是 内容?加入引号试试

 

s elect 工程类型,sum(case when 工程类型 = \'全过程\' then 1 else 0 end) as 全过程,sum(case when 工程类型 = \'工程决算\' then 1 else 0 end) as 工程决算
from 工程统计表
group by 工程类型