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: DISTINCT and MAX

Re: DISTINCT and MAX

From: Nick P <nick_pope_at_hotmail.com>
Date: Sat, 7 Apr 2001 14:50:28 +0100
Message-ID: <tcu6plig7orj15@xo.supernews.co.uk>

I think Ole wants the order numbers for the MAX order date.... but he accidentally put the wrong word.

Ole if you want all order numbers that occurred on the MAX order date, I think you may find that you have a time component recorded in your date, hence only one order coming back. i.e. Your order date records that day and time that the order occurred.

"Mike Moore" <hicamel_at_mail.home.com> wrote in message news:Q2vz6.8467$4L4.916050_at_news1.frmt1.sfba.home.com...
> Not really sure what you want because you say you want to select
 orderdates
> and then what you do is select ordernumber.
>
> maybe
> select ordernumber max(orderdate) from ordertable group by ordernumber;
> will give you what you want.
> Mike
>
> Ole Christian <olecl_at_stud.idb.hist.no> wrote in message
> news:3ACD937C.94429310_at_stud.idb.hist.no...
> > My problem is like so:
> > I want to select multipel orderdates which have the same date as the
> > MAX-date of the table.
> > But I'm just getting one date, the max date.
> > I'm using this command:
> >
> > select distinct orderenumber from ordertable where orderdate=(select
> > max(orderdate) from ordertable)
> >
> > Ole C.
> > PS. I need help quickly...
> >
>
>
Received on Sat Apr 07 2001 - 08:50:28 CDT

Original text of this message

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