I have a table like this:
rowInt Value 2 23 3 45 17 10 9 0 ....
The rowInt column values ββare integers, but not in sequence with the same magnification. I can use the following sql to list rowInt values:
SELECT * FROM myTable ORDER BY rowInt;
The rowInt values ββwill be listed here. How to get the difference of values ββbetween two rows with the result as follows:
rowInt Value Diff 2 23 22 --45-23 3 45 -35 --10-45 9 0 -45 --0-45 17 10 10 -- 10-0 ....
The table is in SQL 2005 (Miscrosoft)
sql sql-server tsql sql-server-2005
David.Chu.ca Mar 11 '09 at 13:43 2009-03-11 13:43
source share