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 Help

Re: Sql Help

From: Ed Prochak <ed.prochak_at_magicinterface.com>
Date: 29 Jul 2005 05:19:52 -0700
Message-ID: <1122639592.708407.246610@z14g2000cwz.googlegroups.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.
>
> can anybody help me Please......
>
> Kishan Thakker

How do you define the "previous row" ?

I have an idea based on txn_dt, but are you looking also for the previous fnd_code? previous txn_no?

your requirements aren't clear, so likely that is your problem. (most of the work in solving a problem lies in figuring out how to phrase the question).

Let us know the details and maybe we can help. I envision something with s self join

SELECT ...
  FROM cum_fifo_figures cff1, cum_fifo_figures cff2   WHERE cff1....

Again, let us know.

   Ed Received on Fri Jul 29 2005 - 07:19:52 CDT

Original text of this message

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