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: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Mon, 01 Aug 2005 22:09:19 +0200
Message-ID: <dclv54$a7f$1@news6.zwoll1.ov.home.nl>


DA Morgan wrote:

> kishanthakker_at_gmail.com wrote:
> 

>> Dear Prochak,
>>
>>
>>>> How do you define the "previous row" ?
>>
>>
>>
>> I M selecting in order of fnd_code,txn_dt,txn_no
>>
>> and I want in the same order previous row.
>>
>> I hope I M clear in my explanation.
>>
>> thanx
>>
>> regards
>>
>> Kishan Thakker
> 
> 
> There is no such thing in a relational database heap table
> as previous. How can "previous" be determined based on application
> logic. The table, itself, has no such concept.

Daniel, cool down, have a sip.
"I select, [and] order [on] fnd_code,txn_dt,txn_no". So when there's 1,2,2/1,2,3/1,3,1/1,3,3
the "previous" record of 1,3,3 would be 1,3,1. the "previous" record of 1,3,1 would be 1,2,3, etc.

Now, the OP had something about running totals?

-- 
Regards,
Frank van Bortel
Received on Mon Aug 01 2005 - 15:09:19 CDT

Original text of this message

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