程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> substring-把這sql是oracle轉為mysql的報錯,但是我沒有找到有子查詢的啊

substring-把這sql是oracle轉為mysql的報錯,但是我沒有找到有子查詢的啊

編輯:編程解疑
把這sql是oracle轉為mysql的報錯,但是我沒有找到有子查詢的啊

select mechdate, sum(settleAmount), sum(mechSeqId), sum(orderamount), sum(settleFee), sum(ROUND(rateAmount,2))
from (select substring(mechdate,1,6) as mechdate,
count(mechSeqId) as mechSeqId,
sum(orderamount) as orderamount,
sum(ORDERAMOUNT - CENTERFEE) as settleAmount,
sum(ORDERAMOUNT - (ORDERAMOUNT - CENTERFEE)) as settleFee,
sum(ORDERAMOUNT*0.0005) as rateAmount
from boc_payinfo
where PROCSTATE = '04' and ACCCHECKSTATE = '02' and mechno = "+mechNo + whereStr+"
group by mechdate) group by mechdate order by mechdate

[Err] 1248 - Every derived table must have its own alias

最佳回答:


from 後面不就是一個大的子查詢嗎。。
報錯信息 查一下是說派生的表必須有別名 group by mechdate) group by mechdate order by mechdate
在這裡給你子查詢出來的表 取個名字呗

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