Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Would be really nice if...

Re: Would be really nice if...

From: <mikharakiri_nospaum_at_yahoo.com>
Date: 28 Feb 2005 14:28:15 -0800
Message-ID: <1109629695.391982.40630@g14g2000cwa.googlegroups.com>


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

-------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> from dual
> ) from EMP

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US