直接贴上一个查询语句吧:
sele m410 as 组织机构代码,m409 as 单位详细名称,m00_a as 数据处理地,;
iif(m399 >
0,iif(m399-m324>0,M406+M397+(M475/m399-1.229)*(m324-m399),M406+M397+(3.16-1.229)*(m324-m399)),M406+M397+(3.16-1.229)*M324)
as 本期等价能耗,;
iif(M405 >
0,iif(M405-M403>0,M401+M402+(M407/M405-1.229)*(M403-M405),M401+M402+(3.16-1.229)*(M403-M405)),M401+M402+(3.16-1.229)*M403)
as
同期等价能耗,;
((M406+M397+(3.16-1.229)*M324)/(M401+M402+(3.16-1.229)*M403)-1)*100
as 同比增长 from a
使用的是iif语句来代替case语句
参考:http://bbs.csdn.net/topics/230027897