# "group by a.xmjlb,a.xmmc"出错！！！

yjdabc 2003-11-13 10:55:36
select xmjlb=(select xmjlb from base_jh_xmjlb where id=a.xmjlb),xmmc=(select xmmc from base_jh_jsxmmc where id=a.xmmc),round(sum(a.sl*a.dj),0) as 零利指标 from htqd_b1 a,base_jh_jsxmmc b where a.xmjlb=b.xmjlb_id and a.xmmc=b.id group by a.xmjlb,a.xmmc order by xmjlb

select xmjlb=(select xmjlb from base_jh_xmjlb where id=a.xmjlb),xmmc=(select xmmc from base_jh_jsxmmc where id=a.xmmc),零利指标=(case when (a.bfb>0 and a.bfb<10) then round(sum(a.sl*a.dj),0)*0.5 else round(sum(a.sl*a.dj),0)*0.8 end) from htqd_b1 a,base_jh_jsxmmc b where a.xmjlb=b.xmjlb_id and a.xmmc=b.id group by a.xmjlb,a.xmmc order by xmjlb

...全文
31 3 打赏 收藏 转发到动态 举报

3 条回复

zjcxc 元老 2003-11-13
• 打赏
• 举报

shuiniu 2003-11-13
• 打赏
• 举报

try:
select xmjlb=(select xmjlb from base_jh_xmjlb where id=a.xmjlb),
xmmc=(select xmmc from base_jh_jsxmmc where id=a.xmmc),

else a.sl*a.dj*0.8 end),0)
from htqd_b1 a,base_jh_jsxmmc b
where a.xmjlb=b.xmjlb_id and a.xmmc=b.id group by a.xmjlb,a.xmmc order by xmjlb
victorycyz 2003-11-13
• 打赏
• 举报

sum(case when (a.bfb>0 and a.bfb<10) then round(a.sl*a.dj),0)*0.5 else round(a.sl*a.dj),0)*0.8 end) as 零利指标

34,615

• 近7日
• 近30日
• 至今