Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> How do I get the most recent entries when ...
I have a table like this:
ID FIELD1 FIELD2 DATE_ENTERED
-- ------ ------ ------------ 1 xxx xxx 01-JAN-1997 2 xxx xxx 05-JAN-1998 1 xxx xxx 05-NOV-2001 2 xxx xxx 14-MAR-1999 1 xxx xxx 15-JAN-1996
Assuming all DATE_ENTERED fields are unique (it is the primary key), how could I formulate a PL-SQL query that only selects the most recent entries per "ID" field. So, in this prmitive example, I'd want the query to return rows 3 and 4 because row 3 is the most recent entry for ID "1" and 4 is the most recent entry for ID "2".
I'm using Oracle 8.1.7, if that matters.
Thanks in advance, Dave A. Received on Tue Feb 05 2002 - 15:04:46 CST
![]() |
![]() |