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

Home -> Community -> Usenet -> c.d.o.misc -> Re: group by problem!!!

Re: group by problem!!!

From: Ales Voboril <alesv_at_post.cz>
Date: Fri, 17 Aug 2001 10:19:21 +0200
Message-ID: <3b7cd34d$1@news.cvut.cz>


Something like that?

select A.sector, A.cnt closed, B.cnt all_events from
( select sector, count(event) cnt from T where status='C' group by sector) A,
( select sector, count(event) cnt from T group by sector) B where A.sector=B.sector;

Ales

gil guerillot <gil.guerillot_at_ratp.fr> wrote in message news:3B7CD7B9.20CBCE8A_at_ratp.fr...
> i'd like to obtain on the same line of my sql select query:
>
> select sector,count(event) closed,count(event) all_events
> from table
> group by sector
>
> but all_events is for all events of course (no where clause on the
> status) and closed is only for events with status 'C'
>
> i did it with a union select but i obtain 2 lines...
>
> how can i do ???
>
> thanks
>
>
Received on Fri Aug 17 2001 - 03:19:21 CDT

Original text of this message

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