I have a table with the following structure:
You just need analytical function sum as follows:
sum
select col1, col2, Sum(col1 - col2) over (order by id) as col3 from t1;
1.4m articles
1.4m replys
5 comments
56.7k users