Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: group by problem!!!
Hi,
you're true. I omitted that.
Anyway, the other's solutions are much better.
Ales
Falko Rotter <fantomas99_at_gmx.de> wrote in message
news:9liu6g$sfi$1_at_newsread2.nexgo.de...
> Hi,
>
> >
> > 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
> >
>
> i'm to fast, my statement was wrong!
> But yours is only nearly correctly. If is in a group of
> a sector no row with status C, then the sector is not
> in the result set. I you want to have all sectors in the
> result you must use an outer join.
>
> --
>
> Best regards,
> Falko Rotter
>
> _________________________________________
>
> - Software Developer -
>
> Rotter & Kalweit Softwaredesign GbR
> Friemarer Straße 38
>
> 99867 Gotha
> GERMANY
>
>
Received on Mon Aug 20 2001 - 05:47:18 CDT
![]() |
![]() |