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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Problem

Re: SQL Problem

From: Phil Paston <p.paston_at_btinternet.com>
Date: Thu, 26 Apr 2001 20:32:38 +0100
Message-ID: <9c9rsi$6l1$1@uranium.btinternet.com>

Thanks for the help
Much appreciated.
unlike the post from Sybrand below - I will be replying to him personally !! "Phineas T. Barnham" <PhineasTBarnham_at_PhineasTBarnham.com> wrote in message news:988140997.5110.0.nnrp-13.9e985e86_at_news.demon.co.uk...
>
> "Phil Paston" <p.paston_at_btinternet.com> wrote
> > I have a very large oracle table with 4 date columns in it date1 date2
 date3
> > and date4
> >
> > Is it possible in sql to write a single query that will give me : the
 max
 of
> > date1 and date3 in a new column and the min of date3 and date4 in a
 sepatate
> > column. or even better :- max of date1 and date3 - min of date3 and
 date4
> > result in a single column. I don`t want to use a union query if I can
 help
> > it as table is very large and i want to do the calc in one pass if at
 all
> > possible.
> >
> You can do it with a combination of functions
>
> min() and max()
> least() and greatest() - I think that's what they're called
>
> so something like
>
> select least(min(date1), min(date2))...
>
> That's the general gist of it - it's all in the manual.
>
> Sorry if I've got the least/greatest function names wrong.
>
>
Received on Thu Apr 26 2001 - 14:32:38 CDT

Original text of this message

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