程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> oracle-請大神改造一下我這個sql語句

oracle-請大神改造一下我這個sql語句

編輯:編程解疑
請大神改造一下我這個sql語句

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

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved