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: Help with this SQL statement please...

Re: Help with this SQL statement please...

From: Walt <walt_askier_at_YerBootsyahoo.com>
Date: Mon, 16 May 2005 12:23:32 -0400
Message-ID: <8O3ie.1467$II.1299@news.itd.umich.edu>


Kenneth Koenraadt wrote:

> On Mon, 16 May 2005 09:27:47 GMT, "harry"  wrote:
> 
> 

>>I have a table called milestone containing this data -
>>
>>mile_id actual_date
>>------- -----------
>>3 12/02/2003
>>1 10/10/2002
>>2 31/01/2003
>>4
>>5
>>6
>>
>>I want a SQL statement to return ONLY the row with the highest mile_id AND
>>with an actual_date.
> 
> 
> Not correct. Instead as simple as :
> 
> select * from milestone where actual_date =(select max(actual_date)
> from milestone);

Um... I think he's actually looking for something like this:

select * from milestone
where mile_id =

   (select max(mile_id)
    from milestone
    where actual_date is not null);

-- 
//-Walt
Received on Mon May 16 2005 - 11:23:32 CDT

Original text of this message

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