Oracle连接不工作



我的版本是11.2.0.4(很快就会迁移到19c)。

我想运行以下sql:

SELECT (select 'hello' from dual) c1 ||','||(select 'hello' from dual) c2
from dual

但是它给出了错误:

SQL>SELECT (select 'hello' from dual) c1 ||','||(select 'hello' from dual) c2
2  from dual
3  ;
SELECT (select 'hello' from dual) c1 ||','||(select 'hello' from dual) c2
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected

你能建议如何修理它吗?请注意,这是"按比例缩小/转换"的。对于一个大型报表sql来说,没有改变查询的自由——我的意思是我们确实需要保留两个子查询,并通过连接它们来连接它们。

您的c1s和c2s还在继续:

SELECT (select 'hello' from dual) ||','||(select 'hello' from dual)
from dual;

你可能想要c2如果这是你想要的列别名。

最新更新