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: SQL question.

Re: SQL question.

From: Mike Heisz <mheisz_at_rim.net>
Date: Mon, 28 Jun 1999 15:18:46 -0400
Message-ID: <newscache$apx1ef$ss8$1@njord.rim.net>


You can use a subquery to do this:

i.e.
select tablename.NAME, tablename.RENTED, tablename.DATE from tablename,
(select NAME, max(DATE)
from tablename
group by NAME) A
where tablename.NAME = A.NAME
and tablename.DATE = A.DATE

This should work for you.

tan <tunrog_at_yahoo.com> wrote in message news:7l407s$c2d$1_at_nnrp1.deja.com...
> I have a simple question, suppose I have a table below:
>
> NAME RENTED DATE
>
> Bob A 03/29/98
> Bob A 05/19/99
> Joe D 12/19/98
> Barb E 03/09/99
> Barb C 06/19/99
> Barb E 09/05/98
>
>
> How do I just retrieve the most recent rows (by date)
> for each person? Thanks.
>
> ie.
> NAME RENTED DATE
>
> Bob A 05/19/99
> Joe D 12/19/98
> Barb C 06/19/99
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Mon Jun 28 1999 - 14:18:46 CDT

Original text of this message

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