I\'ve been stumped with some SQL where I\'ve got several rows of data, and I want to subtract a row from the previous row and have it repeat all the way down.
So her
What about something like this:
SELECT T2.ID, T2.[Length], T2.[Length]-T1.[Length] AS 'Difference' FROM Foo AS T1 RIGHT OUTER JOIN Foo AS T2 ON ( T1.ID = (T2.ID-1) ) ORDER BY T1.ID