Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Count number of hits.
Daniel Morgan <dmorgan_at_exesolutions.com> wrote in message news:<3DDAD17F.6BA6E4B9_at_exesolutions.com>...
> Kenneth Osenbroch wrote:
>
> > Hi all.
> >
> > I want to show the number of hits of a certain status from a table.
> > The result should be something like this:
> >
> > Custnr StatusA StatusB StatusC
> > 123456 1 0 0
> > 123457 0 0 0
> > 123458 3 1 0
> > 123459 9 2 2
> > .
> > .
> >
> > Can anybody help me with this? Any help would be greatly appreciated
> > :o)
> >
> > /Kenneth
>
> Show us your best attempt and we will give you hints.
>
> Daniel Morgan
Hi again, and thanks for your reply.
By using the following query, I manage to list and count all statuses I want.
SELECT INVSUBSNR, INVINVOICESTATUS, COUNT(1)
FROM
INVOICES
WHERE
(INVINVOICESTATUS IN ('R' ,'1' ,'2' ,'5' ,'6' ,'7') ) OR (INVINVOICESTATUS IN ('W' ,'4' ) ) OR (INVINVOICESTATUS IN ('C' ) )
/Kenneth Received on Mon Nov 25 2002 - 01:25:07 CST
![]() |
![]() |