Hi Mike...
Try this code block ...
Declare @MyTestTable table
(
id Int,
PointValue int
)
Insert into @MyTestTable Values (1,150)
Insert into @MyTestTable Values (2,350)
Insert into @MyTestTable Values (3,500)
Insert into @MyTestTable Values (4,100)
Insert into @MyTestTable Values (5,150);
With tblDifference as
(
Select Row_Number() OVER (Order by id) as RowNumber,id,PointValue from @MyTestTable
)
Select Cur.PointValue as CurrentValue, ISNULL(Prv.PointValue,0) as PreviousValue,ISNULL(Cur.PointValue-Prv.PointValue,0) as Difference from
tblDifference Cur Left Outer Join tblDifference Prv
On Cur.RowNumber=Prv.RowNumber+1
Order by Cur.id