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

How to work around count discarding null rows?

From: Matt Novinger <aeaas_at_yahoo.com>
Date: 28 Oct 2002 08:10:40 -0800
Message-ID: <19809582.0210280810.54b35ef6@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 Received on Mon Oct 28 2002 - 10:10:40 CST

Original text of this message

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