I have similar problem. Can you anyone give me solution. Below is the table value
10
20
30
40
I want output like this
10 10-2 8
20 20-8 12
30 30-12 18
40 40-18 22
Sort by ascending and always substract 2 for the first recrod and use the result for the subsequent records.