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 -> Return keyword from max value held in multiple columns

Return keyword from max value held in multiple columns

From: Tim Frawley <tim_frawley_at_fishgame.state.ak.us>
Date: 20 Dec 2004 12:23:11 -0800
Message-ID: <1103574191.332936.125140@f14g2000cwb.googlegroups.com>


I am attempting to return a keyword of 'Novice', 'Journey' or 'Expert' based on dates held in three columns and the userid.

The date references the day when that user achieved that level of competence. A sample of the data would be like:

create table t_ (userid char(3),
novice date,
journey date,expert date)

insert into t_ values ('ABC',

to_date('10/15/2003','dd-mon-yyyy'),
to_date('12/15/2003','dd-mon-yyyy'),
to_date('1/15/2004','dd-mon-yyyy'))

insert into t_ values ('DEF',
to_date('1/15/2004','dd-mon-yyyy'),
null,
to_date('12/15/2003','dd-mon-yyyy'))

insert into t_ values ('XYZ',
to_date('10/15/2003','dd-mon-yyyy'),
to_date('12/15/2003','dd-mon-yyyy'),
null)

My other issues are that the dates may not be Novice least to Expert max (just in case entry is fouled up) and the issue of nulls. Can anyone help me? Received on Mon Dec 20 2004 - 14:23:11 CST

Original text of this message

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