标签:数据 2014 ar ef ui rom on select
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
标签:数据 2014 ar ef ui rom on select
原文地址:http://www.cnblogs.com/nlg3413/p/3898029.html