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!

Query Help

fameApr 4 2016 — edited Apr 5 2016

Hi all,

          This is my table data,

select * from cust_det;

cust_id      pri_amount         pri_paid     order

001              10000               100             1

001              10000               200             2

001              10000               300             3

001              10000               200             4

001              10000               100             5

001              10000               600             6

Required result:

cust_id      pri_amount         pri_paid    order        pri_bal

001              10000               100              1         9900

001              10000               200              2         9700               

001              10000               300                    9400

001              10000               200             4         9200

001              10000               100              5         9100

001              10000               600             6         8500


How can achieve it in single query.

This post has been answered by Paulzip on Apr 4 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 3 2016
Added on Apr 4 2016
7 comments
436 views