码迷,mamicode.com
首页 > 其他好文 > 详细

各商业调拨数据查询

时间:2015-05-27 19:25:14      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:时空

长治购进数据


select e.rq,b.dwmch,c.spmch,c.shpgg,c.dw,c.jlgg,c.shengccj,c.shpchd,d.huowname,

       a.pihao,a.baozhiqi,a.sxrq,a.shl,a.dj,a.hshj,

       a.je,a.shlv,a.she,a.hsje,e.ywy

  from jh_rkmx a(nolock)

       join spkfk c(nolock) on a.spid=c.spid

       left join huoweizl d(nolock) on a.hw=d.hw 

       join jh_rkhz e(nolock) on e.djbh=a.djbh

       join mchk b(nolock) on e.dwbh=b.dwbh

  where (a.djbh like ‘JH%‘)

     and b.dwmch like ‘%振东%‘ and b.isjh=‘是‘ and b.beactive=‘是‘

and d.hw not in (‘HWI00000040‘,‘HWI00000041‘,‘HWI00000044‘,‘HWI00000045‘,‘HWI00000046‘)

      and e.rq>=‘2015-01-01‘

  order by b.danwbh,a.rq,a.djbh



  select b.dwmch,left(a.rq,7) as yue,count(distinct a.spid) pzsh,sum(a.hsje) hsje

  from jh_rkmx a(nolock)

       join spkfk c(nolock) on a.spid=c.spid

       left join huoweizl d(nolock) on a.hw=d.hw 

       join jh_rkhz e(nolock) on e.djbh=a.djbh

       join mchk b(nolock) on e.dwbh=b.dwbh

  where (a.djbh like ‘JH%‘)

     and b.dwmch like ‘%振东%‘ and b.isjh=‘是‘ and b.beactive=‘是‘

      and e.rq>=‘2015-01-01‘

and d.hw not in (‘HWI00000040‘,‘HWI00000041‘,‘HWI00000044‘,‘HWI00000045‘,‘HWI00000046‘)

group by b.dwmch,left(a.rq,7)

  order by b.dwmch,yue


大同购进情况


 select e.rq,b.dwmch,c.spmch,c.shpgg,c.dw,c.jlgg,c.shengccj,c.shpchd,d.huowname,

       a.pihao,a.baozhiqi,a.sxrq,a.shl,a.dj,a.hshj,

       a.je,a.shlv,a.she,a.hsje,e.ywy

  from ywmxk a(nolock)

       join spkfk c(nolock) on a.spid=c.spid

       left join huoweizl d(nolock) on a.hw=d.hw 

       join cwk e(nolock) on e.djbh=a.djbh

       join mchk b(nolock) on e.dwbh=b.dwbh

  where (a.djbh like ‘JH%‘)

     and b.dwmch like ‘%振东%‘ and b.isjh=‘是‘ and b.beactive=‘是‘

      and e.rq>=‘2015-01-01‘

  order by b.danwbh,a.rq,a.djbh




  select b.dwmch,left(a.rq,7) as yue,count(distinct a.spid) pzsh,sum(a.hsje) hsje

  from ywmxk a(nolock)

       join spkfk c(nolock) on a.spid=c.spid

       left join huoweizl d(nolock) on a.hw=d.hw 

       join cwk e(nolock) on e.djbh=a.djbh

       join mchk b(nolock) on e.dwbh=b.dwbh

  where (a.djbh like ‘JH%‘)

     and b.dwmch like ‘%振东%‘ and b.isjh=‘是‘ and b.beactive=‘是‘

      and e.rq>=‘2015-01-01‘

group by b.dwmch,left(a.rq,7)

  order by b.dwmch,yue


各商业调拨数据查询

标签:时空

原文地址:http://bks2015.blog.51cto.com/9847303/1655667

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!