Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie question: get last record of a series

Re: Newbie question: get last record of a series

From: Chris Nelson <ChrisNelson_at_eaton.com>
Date: Wed, 21 Apr 1999 17:05:46 -0400
Message-ID: <371E3DA9.6C41EE6D@eaton.com>


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

Original text of this message

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