0
我試圖做聯合查詢和與我得到總和的聯合查詢 - 語法錯誤 - SQL服務器
Syntax error: incorrect syntax near ')'
代碼:
select
sum(rate)
from
(select
sum(UnitsDelivered * Rate) as rate
from
Reimbursement_EBSUtilization
where
PRR_Id = 1
UNION ALL
select
sum(Reimbursement_CDSUtilization.Rate * CDSUtilization.UnitsDelivered) as rate
from
Reimbursement_CDSUtilization
left join
CDSUtilization on Reimbursement_CDSUtilization.CDSU_Id = CDSUtilization.Id
where
Reimbursement_CDSUtilization.PRR_Id = 270
)--syntax error is showing here
我確信我很失去了一些東西小而無法弄清楚
'其中Reimbursement_CDSUtilization.PRR_Id = 270 )x'您需要爲您的子查詢使用任意名稱進行別名。 ''''後' –
'嘗試'作爲t'其中t是一個別名 – Sachu
哎呀我錯過了。謝謝。有用。 :) –