统计出口分布
---所有分布
use oa
select tradeCountry as 国家,SUM(usdMoney) 美元,SUM(rmbMoney) as 人民币 from az_entry_bill where dDate between '20170101' and '20170930' group by tradeCountry
---美国占比
select SUM(CASE WHEN tradeCountry ='美国' then rmbMoney else 0 end)/SUM(rmbMoney) as 美国占比 from az_entry_bill where dDate between '20170101' and '20170930'
到货单列表
use UFDATA_003_2018
Select * From pu_ArrHead where ddate >= N'2018-10-01' and ddate <= N'2018-10-26' and cmaker='杜玉君' order by id asc
Select * From pu_ArrHead with(nolock) inner join pu_ArrBody with(nolock) on pu_ArrHead.id=pu_ArrBody.id Where 1=1 And ( 1=1 And ((cInvCode >= N'20100002') And (cInvCode <= N'20100002')) And ((ddate >= N'2018-10-01') And (ddate <= N'2018-10-26'))) order by pu_ArrHead.id asc
select * from RdRecord01 inner join rdrecords01 on rdrecord01.ID=rdrecords01.ID Where 1=1 And ( 1=1 And ((cInvCode >= N'20100002') And (cInvCode <= N'20100002')) And ((ddate >= N'2018-10-01') And (ddate <= N'2018-10-26'))) order by ipurarriveid asc