首页 > 解决方案 > SQL 错误 [909] [42000]:ORA-00909:参数数量无效

问题描述

我正在尝试将报告从 postgreSQL 数据库检索到 Oracle 数据库,但它并没有像我想象的那样工作。我试图在 Oracle 数据库中查找相关表,发现它们为 SOR 表,一些数据在 Datamarts 中。

SQL 错误 [909] [42000]:ORA-00909:参数数量无效

在 postgreSQL 中运行良好的 SQL 语句:

`SELECT
    'loan' as product, 
   count(cc.id), 
   cc."type", 
   cc.topic, 
   cc.direction, 
   TRIM(cc.subject) AS subject,
   case when EXISTS (SELECT caf.communication_id
    FROM serp_bigmoney_lv.comm_attachment_files caf where cc.id = caf.communication_id) then 
'yes' 
    else 'no' end as file_attached, 
   concat(us."name",' ',us.surname) as user_name, 
   cc.createdat::date
from erp_bigmoney_lv.comm_communication cc
left join erp_bigmoney_lv.erp_users us on us.user_id = cc.created_by
where cc."type" = 'note' 
GROUP BY cc.createdat::date, user_name, file_attached, cc.direction, cc.topic, cc."type", 
product, cc.subject`

标签: sqloracle

解决方案


CONCAT 函数只接受两个参数使用 || 连接字段,如:

FIELD_1 || ‘ ‘ || FIELD_2

推荐阅读