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: a select within a count ??

Re: a select within a count ??

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Tue, 01 Jul 2003 10:25:26 +0000
Message-ID: <bdrgmg$d7c$1@ctb-nnrp2.saix.net>


Andre wrote:

> select count(*), count(select distinct My_id from Anytable where My_id
> < 1000) from Anytable;
>
> In other words I want to execute a subquery within a count-statement.
> Is it possible ???

What exactly are you trying to achieve? Mebbe if you state the problem instead of what you think the solution, we can better assist you.

BTW, this should work and provide the exact same results as what you're looking for:

In-line views. Cartesian join.

select * from
 (select count(*) from user_objects),
 (select count(distinct object_type) from user_objects where rownum < 10);

--
Billy
Received on Tue Jul 01 2003 - 05:25:26 CDT

Original text of this message

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