ORA-00909:无效的参数数量ERROR

时间:2014-07-15 18:10:57

标签: sql oracle

我有一个使用链接服务器到Oracle的sql服务器,我试图求和并计算一些值,但得到上述错误。我试图按照部门代码和法典对它进行分组,但我不确定我在这里做错了什么?请注意我从Oracle服务器提取数据。 这就是我所拥有的:

 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 ' )

1 个答案:

答案 0 :(得分:3)

我最好的猜测是round()功能。它需要两个参数,而不是sum()

   ROUND(SUM(CHARGES), 2) AS CHARGES