I am fairly new to oracle and SQL and I am having a little trouble figuring out how to accomplish a task.
I have three columns from a table, we will call them 'a', 'b', and 'id'. I first want to order by 'id' and then query the ordered data with the following condition.
I want to add the value at column 'a' to the value at column 'b' and then check and see if that sum is equal to the next value in column 'b'.
If that is not possible, I may also be able to add up column 'a' and column 'b' (take the sum of each column, grouped by 'id') and then subtract the last value in column 'a' grouped to each id from column 'a' and then compare the value of column a (sum(a) - last_value(a), with respect to the id from the 'id' column) with the sum of column 'b' (sum(b))
Any help would be appreciated!