Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Tricky SQL Problem
Try this
Select id, max(date)
from TABLE
group by id
order by id;
--
Kevin A Lewis (BOCM PAULS LTD - Animal Feed Manufacturer - Ipswich England)
<KevinALewis_at_HotMail.com>
The views expressed herein by the author of this document
are not necessarily those of BOCM PAULS Ltd.
Matt Randle <matt_at_imat.demon.co.uk> wrote in message
news:925471736.21781.0.nnrp-07.d4e48d0d_at_news.demon.co.uk...
> We have a table that is keyed on a unique ID + a Date Time value. Using
> Oracle SQL is there any way of finding the most recent assignments by ID.
>
> For example, if the table was populated as follows (British dates),
>
> ID Date Time + Additional Columns
>
> 1 1/1/99
> 1 5/3/99
> 1 6/4/99
> 2 4/4/99
> 2 28/5/99
> 3 1/4/99
> 4 27/2/99
> 4 5/5/99
> 4 9/8/99
>
> The result set should be,
>
> ID Date Time + Additional Columns
>
> 1 6/4/99
> 2 28/5/99
> 3 1/4/99
> 4 9/8/99
>
> Thanks in advance,
>
> Matt.
>
>
>
>
>
Received on Fri Apr 30 1999 - 06:53:04 CDT