Oracle SQL-嵌套子查询引发括号异常

时间:2018-07-25 10:36:54

标签: oracle

我得到了以下oracle-sql语句:

select xxx.a, xxx.b, xxx.c, xxx.d,
(SELECT e FROM ghj WHERE f in (SELECT u FROM hgz WHERE ddf = xxx.ddf limit 
1)) AS fff
from fcv xxx where k = '100';

我收到以下错误:ORA-00907:缺少右括号ORA-06512:在“ SYS.DBMS_SQL”行1185 ORA-06512:在行1

为什么?

1 个答案:

答案 0 :(得分:0)

关于注释,请删除该限制,因为它不是oracle语法

select xxx.a,
       xxx.b,
       xxx.c,
       xxx.d,
       (SELECT e FROM ghj WHERE f in (SELECT u FROM hgz WHERE ddf = xxx.ddf 
       FETCH FIRST 1 ROWS ONLY) FETCH FIRST 1 ROWS ONLY) AS fff
  from fcv xxx
 where k = '100';