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

Home -> Community -> Usenet -> c.d.o.server -> Decode and Ranges?

Decode and Ranges?

From: JCEdleman <jcedleman_at_aol.com>
Date: 1 Mar 1999 02:44:38 GMT
Message-ID: <19990228214438.22626.00001678@ng148.aol.com>


Hi,

Here is what I am trying to do:

In one SQL statement using Decode ( or another function you might suggest), validate a numeric range so . . .

If the row value is between 6 and 10 display a count of records.

Psydo -code:
Select gender_cd,
count(decode(round(months_between(birth_dt,sysdate)/12),between 6 and 10, total count))) "Age 6-10"
from members
where . . . . .

Result would look like this:

              Age 6-10   Age 11-15
Males          5               10
Females      6                22


Received on Sun Feb 28 1999 - 20:44:38 CST

Original text of this message

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