sql - 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`
解决方案
CONCAT 函数只接受两个参数使用 || 连接字段,如:
FIELD_1 || ‘ ‘ || FIELD_2
推荐阅读
- python - Chainer 和 float64 支持
- python - 为什么我们在写装饰器的时候不调用函数而不是返回它呢?
- python - 如何按文件名过滤 QFileSystemModel 的文件列表?
- c# - 来自左外连接的分组值
- node.js - 在 Node Js 上流式传输
- angular - FormControl valueChanges.subscribe vs keyup
- javascript - PointerCapturing OnLoad
- python - Jupyter Notebook 不记得我在上面的单元格中创建的变量
- javascript - 我应该在我的应用程序/游戏中使用轮询还是套接字?
- sql - 在 SQL 中使用 MIN 或 Max 时如何避免 Group By