Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How get maximum of two columns
Save some typing ... use greatest
select greatest(date1, date2) .....
Anurag
"Dave Hau" <davehau_nospam_123_at_nospam_netscape.net> wrote in message news:3F3AB07C.5080004_at_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 - 17:05:21 CDT