I have three columns in my table the name of the column is date_time,total,sub and i want to update the existing sub column by subtracting previous row total value and next row total value by order of date_time column using mysql.I don't know how to achieve this result.The data are given below
date_time total sub
2019-03-07 12:32:10 50 0
2019-03-07 12:34:22 60 0
2019-03-07 12:37:17 75 0
2019-03-07 12:44:10 100 0
i want to update the above record as
date_time total sub
2019-03-07 12:32:10 50 0
2019-03-07 12:34:22 60 10
2019-03-07 12:37:17 75 15
2019-03-07 12:44:10 100 25
Please guide me to achieve this result