Skip to content
Advertisement

how do i insert value into a column and referring the previous value at the same time of that column in a Table in Oracle?

I have a table where I have to insert values in Final_value column

Explanation of the task

  1. First value of the Final_value column will be = 1st value of column1 i.e 5.5

  2. From the 2nd row we will check if column2 is Not Null
    a) if TRUE , then formula would be
    previous Final_value column* ( current column1 value/previous Column1 value ) + column2 value * (previous column1 value/ previous Final_value )

    b) if FALSE, then formula would be the Previous value of Final_value column * ( current value of column1/ previous value of column 1)

Required Output

Advertisement

Answer

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement