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

Help with this SQL statement please...

From: harry <spammemothers_at_yahoo.co.uk>
Date: Mon, 16 May 2005 09:27:47 GMT
Message-ID: <nIZhe.32707$G8.24337@text.news.blueyonder.co.uk>


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. This works -

    SELECT MAX(mi.mile_id), MAX(mi.actual_date) FROM milestone mi WHERE AND mi.actual_date IS NOT NULL

returning

    3 12/02/2003

which is correct but is this the best way? - the bit I'm really querying is the "MAX(mi.actual_date)"

many thanks

harry Received on Mon May 16 2005 - 04:27:47 CDT

Original text of this message

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