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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: help with query

Re: help with query

From: Dennis M. Heisler <dheisler_at_binghamton.edu>
Date: Fri, 04 Aug 2000 10:45:44 -0400
Message-Id: <10579.113857@fatcity.com>


How about

select a.id, a.date, a.amount from table1 a where date = (select max(date) from table1 b where a.id = b.id);

Dennis

Ashish Shah wrote:

> Hi all,
>
> Here is the data..
>
> id date amount
>
> 1 15-jul-00 100
> 1 15-jul-00 50
> 1 15-jul-00 200 <<<<<<<<
> 2 15-jul-00 50
> 2 15-jul-00 100 <<<<<<<<
>
> I need to get a row with max(date) (Date field is
> with time so we can get last row that was inserted)
> for each user..
>
> so my output should be
>
> 1 15-jul-00 200
> 2 15-jul-00 100
>
> Any idea??
>
> TIA
>
> =====
> Ashish
> Toronto, Canada
>
> __________________________________________________
> Do You Yahoo!?
> Kick off your party with Yahoo! Invites.
> http://invites.yahoo.com/
>
> --------
> If you're bored, then visit the list's website: http://www.lazydba.com (updated daily)
> to unsubscribe, send a blank email to oracledba-unsubscribe_at_quickdoc.co.uk
> to subscribe send a blank email to oracledba-subscribe_at_quickdoc.co.uk
Received on Fri Aug 04 2000 - 09:45:44 CDT

Original text of this message

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