create table test (id int,t1 int,t2 int,t3 int)
insert test select    
1,10,20,30    
union all select    
3,9,18,20    
union all select    
7,8,15,16    
//创建一个test表并插入数据
select * from test//查询数据是否正确
--drop table test // 删除test表

select *,
t4=t1-isnull((select top 1 t1 from test where id>t.id),0),
t5=t2-isnull((select top 1 t2 from test where id>t.id ),0),
t6=t3-isnull((select top 1 t3 from test where id>t.id ),0)
from test t