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: Count number of hits.

Re: Count number of hits.

From: Kenneth Osenbroch <kenneth.osenbroch_at_canaldigital.com>
Date: 24 Nov 2002 23:25:07 -0800
Message-ID: <9c941a28.0211242325.53fc0680@posting.google.com>


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' ) )

GROUP BY INVSUBSNR, INVINVOICESTATUS; Any hints on how I can get the result out in mentioned manner?

/Kenneth Received on Mon Nov 25 2002 - 01:25:07 CST

Original text of this message

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