Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie question: get last record of a series
Hi, Bob.
Maybe this would work for you:
SELECT DISTINCT field1 || field2 || field3
FROM table
GROUP BY field1 || field2 || field3, date_field
HAVING date_field = MAX( date_field)
/
Chris
Bob McConnell wrote:
> I have a table like this:
> field1 field2 field3 date_field
> ABCD 0 0 1 apr 99
> ABCD 0 0 2 apr 99
> ABCD 0 1 1 apr 99
> ABCD 1 1 2 apr 99
> ABCD 1 1 3 apr 99
>
> I need to return in this case rows 2,3 and 5
> the latest date for the unique combinations of field1,2 and 3
>
> tia,
> Bob
Received on Wed Apr 21 1999 - 16:05:46 CDT
![]() |
![]() |