Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: latest date
A copy of this was sent to wellsv_at_mail.modot.state.mo.us (Vicki) (if that email address didn't require changing) On 24 May 2001 12:26:31 -0700, you wrote:
>I need a way to filter out the latest date for records that have more
>than one entry. I have vehicle numbers with entries in a another field
>with the date of inspection. How can I get just the latest date?
select *
from t
where date_field = ( select max(date_field)
from t t2 where t2.primary_key_field = t.primary_key_field )/
will do it.
-- Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries Howtos and such: http://asktom.oracle.com/ http://asktom.oracle.com/~tkyte/ Oracle Magazine: http://www.oracle.com/oramag Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Thu May 24 2001 - 20:17:40 CDT