I have a SQL 2008 database table like this
name score
-----------------------
steve 207
steve 205
steve 200
steve 139
I want to get the difference between the rows. eqn = [row – (row + 1)]
so I would ideally want it to be,
steve 2 //207 - 205
steve 5 //205 - 200
steve 61 //200 - 139
steve 139 //139 - 0
What is the best way to do this?
Thanks!
This is one way to do it