聚集函数内的子查询-出错

--1. 无法执行
select sum(
       select n from 	  --ORA-00936: 缺失表达式
       (select to_number('1') as n from dual
       union all
       select to_number('2') as n from dual)
) from dual

--2. 可以执行
select sum(n) 
from
 (select n from
       (select to_number('1') as n from dual
       union all
       select to_number('2') as n from dual
       )
)

哪位仁兄给 详细解释一下,为什么第1种情况在oracle里会报错?或提供可参考的资料 OTZ


你可能感兴趣的:(oracle)