Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Would be really nice if...
mikharakiri_nosp..._at_yahoo.com wrote:
> SELECT COLUMNS(
> select name, name || '_EMP'
> from user_columns
> where table_name = 'EMP'
> union
> select (select sum(1) from dept
> where dept.deptno = emp.deptno) dept_count
-------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It rather has to be
SELECT COLUMNS(
select name, name || '_EMP'
from user_columns
where table_name = 'EMP'
union
select ROWS(select sum(1) from dept
where dept.deptno = emp.deptno), 'dept_count'
from dual
) from EMP
ROWS is an expression that has to be evaluated per each tuple. Received on Mon Feb 28 2005 - 16:28:15 CST