首页 > 代码库 > 【数据处理】大库订货数据匹配
【数据处理】大库订货数据匹配
select distinct a.商品编码,a.品名,a.规格,a.最终进价 大库价格,c.curcsprc 进价,a.最终进价-c.curcsprc 差价,d.qty 西部,e.qty 东部,f.qty 中区
from lhdh201408 a
left join lhspm b on a.商品编码=b.pluid
left join 商品码 c on b.barcode=c.bcd
left join (select pluno,sum(qty) qty from xbxs where rq between ‘20140501‘ and ‘20140801‘ group by pluno ) d on c.pluno=d.pluno
left join (select pluno,sum(qty) qty from dbxs where rq between ‘20140501‘ and ‘20140801‘ group by pluno ) e on c.pluno=e.pluno
left join (select pluno,sum(qty) qty from zqxs where rq between ‘20140501‘ and ‘20140801‘ group by pluno ) f on c.pluno=f.pluno
order by 2
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。