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 -> counting zeros

counting zeros

From: Mark Hamilton <user_at_user.net>
Date: Mon, 11 Mar 2002 15:45:44 -0900
Message-ID: <u8qju1o4il0le3@corp.supernews.com>

Hello all,

Oracle 7.3.3 on NT

I'm looking for a pure SQL method of counting grouped records even if there are no instances to count.

My current SQL:

This gives counts of all instnaces of records. However, if there are departments with 'Rep' employees but not 'Non-Rep' employees, this needs to be indicated with a '0' (i.e.<group>, NonRep, 0). I have tried decoding the 'count(j.emplid)' record looking for zero, but was not successful.

Any ideas?

Thanks,
Mark Received on Mon Mar 11 2002 - 18:45:44 CST

Original text of this message

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