Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: group by problem!!!
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