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 -> Re: How get maximum of two columns

Re: How get maximum of two columns

From: Dave Hau <davehau_nospam_123_at_nospam_netscape.net>
Date: Wed, 13 Aug 2003 21:41:17 GMT
Message-ID: <3F3AB07C.5080004@nospam_netscape.net>


select (case when date1 > date2 then date1 else date2 end) "mydate" from mytable;

Cheers,
Dave

oracle_adam_at_nospam.com wrote:
> I have two date columns in a table, DATE1 and DATE2.
>
> How do I get the maximum of DATE1 and DATE2 in a select statement (no PL/SQL),
> something like SELECT MAXIMUM(DATE1,DATE2) FROM <TABLE>?
>
> Many thanks
>
> ----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
> http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
> NewsOne.Net prohibits users from posting spam. If this or other posts
> made through NewsOne.Net violate posting guidelines, email abuse_at_newsone.net
Received on Wed Aug 13 2003 - 16:41:17 CDT

Original text of this message

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