select ROUND((sum(ORDERAMOUNT)*0.0005),2) as s from boc_payinfo t where 1=1 and mechDate >= '20161001' and mechDate <= '20161003' and PROCSTATE = '04' and ACCCHECKSTATE = '02' and mechno = 00001 group by mechdate
ROUND((sum(ORDERAMOUNT)*0.0005),2) 這句需要用sum包裹,oracle可以,mysql不行,現在需要用MySQl
SELECT sum(t.s) from(
select ROUND((sum(1)*0.0005),2) as s FROM boc_payinfo t where 1=1 and mechDate >= '20161001' and mechDate <= '20161003' and PROCSTATE = '04' and ACCCHECKSTATE = '02' and mechno = 00001 group by mechdate
) t