| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1057 人关注过本帖
标题:我想取出 里面chint—code等字段罗列出来 就大神们帮忙
只看楼主 加入收藏
xiaowai110
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-7-22
收藏
 问题点数:0 回复次数:0 
我想取出 里面chint—code等字段罗列出来 就大神们帮忙
select sum1-sum2 from
(
select sum(bbje) as sum1 from(
select chint_manager.chint_code as chint_code, chint_manager.subscribedate as subscribedate,
chint_manager.projectid as projectid, bd_cubasdoc.custcode as custcode, chint_manager.operid as operid,
bd_cubasdoc.bp2 as bp2, chint_manager.promanager as promanager, chint_manager.nbhtje as nbhtje,
chint_manager.paycom as paycom, chint_manager.nbhtje-chint_manager.paycom as bcqk,
bd_jobbasfil.jobname as jobname, bd_cubasdoc.custname as custname, bd_cubasdoc.custcode as custcode,arap_djzb.paydate as paydate,
arap_djfb.sfbz as sfbz, arap_djlx.dr as dr, arap_djlx.djlxbm as djlxbm, arap_djzb.bbje as bbje,
arap_djlx.dwbm as dwbm
from chint_manager  
inner join  bd_cumandoc on chint_manager.promanager = bd_cumandoc.pk_cumandoc  
inner join  bd_cubasdoc on bd_cumandoc.pk_cubasdoc = bd_cubasdoc.pk_cubasdoc  
inner join  bd_jobmngfil on chint_manager.projectid = bd_jobmngfil.pk_jobmngfil  
inner join  bd_jobbasfil on bd_jobmngfil.pk_jobbasfil = bd_jobbasfil.pk_jobbasfil  
inner join  bd_corp on bd_cumandoc.pk_corp = bd_corp.pk_corp  
inner join  arap_djzb on bd_cumandoc.pk_cumandoc = arap_djzb.zyx2  
inner join  arap_djfb on arap_djzb.vouchid = arap_djfb.vouchid  
inner join  arap_djlx on arap_djzb.djlxbm = arap_djlx.djlxbm
)aa
where aa.djlxbm in ('D0','2349','2346','D1','23A1') and aa.sfbz=3 and aa.dr=0 and
 aa.dwbm=1004
 )cc
left outer join
(
select sum(bbje) as sum2 from(
select chint_manager.chint_code as chint_code, chint_manager.subscribedate as subscribedate,
chint_manager.projectid as projectid, bd_cubasdoc.custcode as custcode, chint_manager.operid as operid,
bd_cubasdoc.bp2 as bp2, chint_manager.promanager as promanager, chint_manager.nbhtje as nbhtje,
chint_manager.paycom as paycom, chint_manager.nbhtje-chint_manager.paycom as bcqk,
bd_jobbasfil.jobname as jobname, bd_cubasdoc.custname as custname, bd_cubasdoc.custcode as custcode,arap_djzb.paydate as paydate,
arap_djfb.sfbz as sfbz, arap_djlx.dr as dr, arap_djlx.djlxbm as djlxbm, arap_djzb.bbje as bbje,
arap_djlx.dwbm as dwbm
from chint_manager  
inner join  bd_cumandoc on chint_manager.promanager = bd_cumandoc.pk_cumandoc  
inner join  bd_cubasdoc on bd_cumandoc.pk_cubasdoc = bd_cubasdoc.pk_cubasdoc  
inner join  bd_jobmngfil on chint_manager.projectid = bd_jobmngfil.pk_jobmngfil  
inner join  bd_jobbasfil on bd_jobmngfil.pk_jobbasfil = bd_jobbasfil.pk_jobbasfil  
inner join  bd_corp on bd_cumandoc.pk_corp = bd_corp.pk_corp  
inner join  arap_djzb on bd_cumandoc.pk_cumandoc = arap_djzb.zyx2  
inner join  arap_djfb on arap_djzb.vouchid = arap_djfb.vouchid  
inner join  arap_djlx on arap_djzb.djlxbm = arap_djlx.djlxbm
)bb
where bb.djlxbm in ('D1','D2','2347','2348','23A0','F1-YJYF','F1-XMF','F1-BZJ')
and bb.sfbz=3 and bb.dr=0 and bb.dwbm=1004
)dd
on 1=1
2012-07-22 09:29
快速回复:我想取出 里面chint—code等字段罗列出来 就大神们帮忙
数据加载中...
 
   



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

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