Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Running balance on transactions

imation3mJun 30 2019 — edited Jun 30 2019

Hello,

I need to calculate the running balance of an account by adding a figure at the start of the month and then adding daily closing balances.

create table table1(

   Acct  varchar2(16),

   trans_date date,

   closing_bal number(19,3)

   )

   ;

  

    insert into table1 values('ACCT1', '24-JAN-19', 242.5);

    insert into table1 values('ACCT1', '28-JAN-19', -300);

   

COMMIT;

So at the start of the month, if balance is 425.128, I need the result like below:

   

Acct
Trans_Date
Running Balance
ACCT124-Jan-19667.628
ACCT128-Jan-19367.628
This post has been answered by mNem on Jun 30 2019
Jump to Answer
Comments
Post Details
Added on Jun 30 2019
8 comments
1,315 views