Re: DECODE HELP SOLVED

2002-05-21 Thread Viktor

Thanks Lyuda and Ron for your help!

--- Lyuda Hoska <[EMAIL PROTECTED]> wrote:
> Something like this would work.  
> SELECT GREATEST(FIRST_DATE,
> NVL(SEC_DATE,THIRD_DATE),NVL(THIRD_DATE,SEC_DATE))
> FROM ;
> Just an idea, you can explore it further..
> 
> -Original Message-
> Sent: Monday, May 20, 2002 3:48 PM
> To: Multiple recipients of list ORACLE-L
> 
> Hello all,
> 
> This has probably been discussed here before and I'm
> sorry if I'm repeating this. But I'd very much
> appreciate if someone could show me how to use
> DECODE
> to select a MAX date where records are like this:
> 
> PRIM. KEY  FIRST_DATE SEC_DATE   THIRD_DATE
> JO001599O 12/14/2000 03/23/2001 05/21/2001 
> JO001620L12/27/2000 05/16/2001 
> 
> The first_date, sec_date and third_date may or may
> not
> exist; either one of the dates will be there. I need
> to come up with another column LATEST_DATE which
> will
> show the latest date of the 3.
> 
> Thanks very much in advance!
> 
> 
> __
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com
> -- 
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> -- 
> Author: Viktor
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services-- (858) 538-5051  FAX:
> (858) 538-5051
> San Diego, California-- Public Internet
> access / Mailing Lists
>

> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from).  You may
> also send the HELP command for other information
> (like subscribing).
> -- 
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> -- 
> Author: Lyuda Hoska
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services-- (858) 538-5051  FAX:
> (858) 538-5051
> San Diego, California-- Public Internet
> access / Mailing Lists
>

> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from).  You may
> also send the HELP command for other information
> (like subscribing).


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Viktor
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



FW: DECODE HELP

2002-05-20 Thread Lyuda Hoska

Something like this would work.  
SELECT GREATEST(FIRST_DATE,
NVL(SEC_DATE,THIRD_DATE),NVL(THIRD_DATE,SEC_DATE))
FROM ;
Just an idea, you can explore it further..

-Original Message-
Sent: Monday, May 20, 2002 3:48 PM
To: Multiple recipients of list ORACLE-L

Hello all,

This has probably been discussed here before and I'm
sorry if I'm repeating this. But I'd very much
appreciate if someone could show me how to use DECODE
to select a MAX date where records are like this:

PRIM. KEY  FIRST_DATE SEC_DATE   THIRD_DATE
JO001599O 12/14/2000 03/23/2001 05/21/2001 
JO001620L12/27/2000 05/16/2001 

The first_date, sec_date and third_date may or may not
exist; either one of the dates will be there. I need
to come up with another column LATEST_DATE which will
show the latest date of the 3.

Thanks very much in advance!


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Viktor
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Lyuda Hoska
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



Re: DECODE HELP

2002-05-20 Thread Ron Thomas


Why use decode.  Look up the "greatest" sql function.

select prim_key, greatest(first_date,sec_date,third_date) from your_table.

Ron Thomas
Hypercom, Inc
[EMAIL PROTECTED]
"The problem with some people is that when they aren't drunk, they're sober."  
--William Butler
Yeats.


   
   
  [EMAIL PROTECTED]
   
  mTo:   [EMAIL PROTECTED]  
   
  Sent by: cc: 
   
  [EMAIL PROTECTED] Subject:  DECODE HELP   
   
   
   
   
   
  05/20/02 01:48 PM
   
  Please respond to
   
  ORACLE-L 
   
   
   
   
   




Hello all,

This has probably been discussed here before and I'm
sorry if I'm repeating this. But I'd very much
appreciate if someone could show me how to use DECODE
to select a MAX date where records are like this:

PRIM. KEY  FIRST_DATE SEC_DATE   THIRD_DATE
JO001599O 12/14/2000 03/23/2001 05/21/2001
JO001620L12/27/2000 05/16/2001

The first_date, sec_date and third_date may or may not
exist; either one of the dates will be there. I need
to come up with another column LATEST_DATE which will
show the latest date of the 3.

Thanks very much in advance!


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Viktor
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ron Thomas
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



DECODE HELP

2002-05-20 Thread Viktor

Hello all,

This has probably been discussed here before and I'm
sorry if I'm repeating this. But I'd very much
appreciate if someone could show me how to use DECODE
to select a MAX date where records are like this:

PRIM. KEY  FIRST_DATE SEC_DATE   THIRD_DATE
JO001599O 12/14/2000 03/23/2001 05/21/2001 
JO001620L12/27/2000 05/16/2001 

The first_date, sec_date and third_date may or may not
exist; either one of the dates will be there. I need
to come up with another column LATEST_DATE which will
show the latest date of the 3.

Thanks very much in advance!


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Viktor
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).