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: analytic function

Re: analytic function

From: sim <jmenker_at_muenster.de>
Date: 20 Jul 2006 04:36:04 -0700
Message-ID: <1153395364.048650.176610@i3g2000cwc.googlegroups.com>

Billou schrieb:

> Hi,
>
> using a select like:
>
> select max(date) over (partition by...)
>
> how can I retrieve a value from the same row than the max(date) ?
> For example, how can I find the price value for the max(date) over that
> partition ?
>
> thank you

You could select not only the max(date) but also the key of the record with max(date) using a group by and then join it with the table. Something like this:

select a.price
from
your_table a,
(
select key

            max(date)
from     your_table

) b
where a.key = b.key

Regards,

Jörg Received on Thu Jul 20 2006 - 06:36:04 CDT

Original text of this message

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