zexal 回复 cy1012(提问者)select c.de_25913 as 国家,b.cus_no 客户编号,b.OS_DD 下单日,b.cas_no 订单号,b.CUR_ID 币种,sum(a.amt)金额
from TF_POS a left join MF_pos b on a.os_no=b.os_no left join sms_saleorder c on b.cas_no=c.dan
where a.OS_ID=\'SO\' and b.cas_no!=\'\'
--and b.cus_no=\'ID014\'
AND b.OS_DD BETWEEN \'${START}\' AND \'${END}\'
group by c.de_25913,b.cus_no,b.OS_DD,b.cas_no,b.CUR_ID
order by c.de_25913,b.cas_no,b.OS_DD