标题:求SQL语句修改
取消只看楼主
qaz6526144
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-3-24
结帖率:0
已结贴  问题点数:20 回复次数:0 
求SQL语句修改
select ays_cost_d.cbs, isnull(sum(ays_cost_d.amt),0) as CB,isnull(((select isnull(sum(pay_amt_d.rep_amt_fc),0) from pay_amt_d left join bd_cbs on pay_amt_d.cbs=bd_cbs.cbsid where bd_cbs.cbsid='10094311')+

(select  isnull(sum(kc_billbody.mony),0)  from  kc_billbody left join bd_cbs on kc_billbody.cbs=bd_cbs.cbsid where bd_cbs.cbsid='10094311')+

(select isnull(sum(fyb_indirect_c.amt_fc),0) from fyb_indirect_c left join bd_cbs on   fyb_indirect_c.cbs=bd_cbs.cbsid where bd_cbs.cbsid='10094311')),0) as SJ

from ays_cost_d left join bd_cbs on ays_cost_d.cbs=bd_cbs.cbsid where bd_cbs.cbsid='10094311'  group by ays_cost_d.cbs

    求高手指导  如何把这个语句糅合成只需要一个定位条件,现在是有四个定位语句!!
2016-03-24 09:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-462847-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.126582 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved