Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Averaging a value except when 0

Re: Averaging a value except when 0

From: Bob Fazio <rfazio_at_home.com.nospam>
Date: 2000/05/07
Message-ID: <197R4.175111$Tn4.1325522@news1.rdc2.pa.home.com>#1/1

Sounds like a student type of question, but try this "where score != 0"

--
Robert Fazio, Oracle DBA
rfazio_at_home.com
remove nospam from reply address
http://24.8.218.197/
"Steven Reid" <macreid_at_primus.com.au> wrote in message
news:3914d2c3_at_news.iprimus.com.au...

> Hi,
>
> I have a database that records the score that a student has received for a
> test.
> A value of 0 has been used to signify that that student did not do that
> test.
>
> What I am trying to do is get averages of both the overall and the
> individual.
> So if a zero has been entered, do not use it for the averaging but I still
> need to keep it in the database for reporting purposes.
>
> I am using Oracle 8.0.5 and VB to access the database.
>
> Student_Number Question Score date
> 1 1 0 1/1/00
> 1 2 5 1/1/00
> 2 1 3 1/1/00
> 2 2 5 1/1/00
> 1 1 3 2/1/00
> 1 2 4 2/1/00
> 2 1 4 2/1/00
> 2 2 4 2/1/00
>
> What I want is to be able to get the following:
>
> Date Question Rating
> Overall 1/1/00 1 3
> 2 5
> Individual 1 1/1/00 1 0
> 2 5
> etc.
>
> Overall All Dates 1 3.33
> 2 4.5
> Indivual 1 All Dates 1 3
> 2 4.5
>
>
> Any help VERY MUCH appreciated.
>
> Steve
>
>
>
>
Received on Sun May 07 2000 - 00:00:00 CDT

Original text of this message

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