troubleshooting Question

I want to compare one row to another then perform action in oracle database

Avatar of ernie_shah
ernie_shahFlag for Trinidad and Tobago asked on
Oracle Database
20 Comments1 Solution311 ViewsLast Modified:
I would like to compare one row to another, if the first row meets the criteria then row1 add row2 call this query1, if query1 meets the criteria then query1 add row3 etc.. for example

date             bbls     rate
2014-03-01    10        100
2014-03-02     20        100
2014-03-05     50        100
2014-03-05     30        100

using the example above:  If bbls on 2014-03-01 < 100 then 2014-03-01 (bbls10) add 2014-03-02 (bbls20) query1(30)
if query1(30) < 100 then query1 add 2014-03-05   (bbls 50)  query2

if query2 (80) < 100 then query2 add 2014-03-05 (bbls30) query3
if query3 > 100 then query3 - 100

I want to be able to perform this row by row calculation......

Can anyone help me please......
Join our community to see this answer!
Unlock 1 Answer and 20 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 20 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros