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: How to work around count discarding null rows?

Re: How to work around count discarding null rows?

From: Alex Filonov <afilonov_at_yahoo.com>
Date: 29 Oct 2002 08:04:21 -0800
Message-ID: <336da121.0210290804.7fcd7d91@posting.google.com>


aeaas_at_yahoo.com (Matt Novinger) wrote in message news:<19809582.0210280810.54b35ef6_at_posting.google.com>...
> I am writing a view that looks takes a table and sorts based on 3
> qualifers and then returns a count of the number of entries in that
> category. For example, a database from a college with
> freshman/sophomore/junior/senior converted to grade equivalents,
> different majors and ethniticities, and the count of the students of
> that race, in that major, in that grade.
>
> Grade Major Ethnicity Count
> 14 12 5 13
> 15 17 4 7
> 15 18 5 0 <--- what I want to output
>
> My problem is I want to output a 0 for the count column where no
> students exist in that grade, major and ethnic group. Count throws
> away null rows like that, and I can't seem to get around this, even
> though it seems like a basic problem. I have tried NVL function, but
> count throws out the null data first, anyone have an idea?
>
> Thanks in advance!
> Matt Novinger
> Penn State Applied Research Labs

Could you post your query, please? Do you use count function? It really ignores nulls and returns 0 if all values it counted are nulls. Received on Tue Oct 29 2002 - 10:04:21 CST

Original text of this message

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