Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Sql Help
On 2005-07-29, kishanthakker_at_gmail.com <kishanthakker_at_gmail.com> wrote:
> I have a very specific problem with oracle 8.0.4.
>
> i have following view
> cum_fifo_figures
> (
> fnd_code varchar2(8),
> txn_dt date,
> txn_no number(3),
> cum_unt number(7),
> cum_amt number(7)
> )
>
> its in order of fnd_code,txn_dt,txn_no
>
> I want to select value of cum_amt of previous row
> while selecting fnd_code,txn_dt,txn_no.
>
> note : in case of first row it should select value from current row.
Look into the lag(..., 1) over(....) analytical function
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Fri Jul 29 2005 - 08:46:21 CDT