日期:2014-05-16 浏览次数:20442 次
select po_num,arr_adress,over_time,c_type,cust_no,mount,
snp,totals,late_time from dfl_stock_detail where po_num = 'SU14031300621'
求得结果:
SU14031300621 A1 2014-03-20 13:55:00.000 L11K 23703EX80A 12 15 180 2014-03-15 15:30:00.000
SU14031300621 A1 2014-03-20 13:55:00.000 L11K 23703EX80A 12 15 180 2014-03-15 15:30:00.000
SU14031300621 A1 2014-03-20 13:55:00.000 L11K 23703JX30A 1 15 15 2014-03-15 15:30:00.000
能不能求得这样的结果:
SU14031300621 A1 2014-03-20 13:55:00.000 L11K 23703JX30A 25 15 375 2014-03-15 15:30:00.000
SELECT
po_num, arr_adress, over_time, c_type, cust_no, SUM(mount), SUM(snp), SUM(totals),
late_time
FROM
dfl_stock_detail
WHERE
po_num='SU14031300621'
GROUP BY
po_num, arr_adress, over_time, c_type, cust_no,late_time