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
In article <371E0F8B.1CDBA0FD_at_mci.com>, bob.mcconnell_at_mci.com
says...
> 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
Newbie answer:
select field1, field2, field3, max(date_field) from table group by
field1, field2, field3;
HTH
--
Gorm Larsen
Hjælp til XAL og AxApta? Abonner på news.tadorna.dk
Received on Wed Apr 21 1999 - 15:37:08 CDT
![]() |
![]() |