日期:2014-05-16 浏览次数:20572 次
select * from dfl_stock_detail where po_num = 'SU14031300627'
得到结果:
id po_num arr_adress over_time c_type cust_no mount snp total late_time
28 SU14031300627 A2 2014-03-19 11:00:00.000 L12F 237033AW0A 25 15 375 2014-03-15 15:30:00.000
29 SU14031300627 A2 2014-03-19 11:00:00.000 L12F 237033RC3A 2 15 30 2014-03-15 15:30:00.000
30 SU14031300627 A2 2014-03-19 11:00:00.000 L12F 237033RC3A 3 15 45 2014-03-15 15:30:00.000
select po_num,
arr_adress,
over_time,
c_type,
cust_no,
SUM(mount),
snp,
total=SUM(mount)*snp,
late_time
from dfl_stock_detail
where po_num = 'SU14031300627'
group by po_num,
arr_adress,
over_time,
c_type,
cust_no,
snp,
late_time