Need To select Data From One Table After Minus With One Value
问题 This question was migrated from Database Administrators Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I have a table and a single value Table 1 SNo Amount 1 100 2 500 3 400 4 100 Value: 800 Now I want the result from the table is Minus the value and finally I would like to having rolling subtraction, that is subtract the Value 800 From Table 1's first Amount and then apply it to subsequent rows. Eg: for type-1 800 - 100 (Record1) = 700 700 - 500 (record2)