2014-07-15 168 views
0

我有sql服務器使用鏈接服務器到Oracle,我想總結和計算一些值,但得到上述錯誤。我試圖按部門代碼和Fac Code進行分組,但我不確定我在這裏做錯了什麼?請注意我從Oracle服務器上提取數據。 這裏是我有:ORA-00909:無效的參數數量ERROR

SELECT * FROM OPENQUERY (MYLINKEDSERVER,'SELECT LTRIM(CODE) AS FAC_CODE, 
     COUNT(ACCOUNT_NO)AS ACCOUNT_NO, 
     LTRIM(DEP_CODE) AS DEP_CODE, 
     SUM(UNITS) AS TOTAL_UNITS, 
     ROUND(SUM(CHARGES, 2)) AS CHARGES 
     from myTable 
     group by CODE, DEP_CODE ') 

回答

3

我最好的猜測是round()功能。它需要兩個參數,而不是sum()

ROUND(SUM(CHARGES), 2) AS CHARGES