- 论坛徽章:
- 0
|
create table test (id int,counter int)
insert into test(id,counter) values(1,3 )
insert into test(id,counter) values(2,4 )
insert into test(id,counter) values(3,6 )
insert into test(id,counter) values(4,9 )
insert into test(id,counter) values(5,13 )
insert into test(id,counter) values(6,18 )
insert into test(id,counter) values(7,24 )
insert into test(id,counter) values(8,31 )
insert into test(id,counter) values(9,39 )
insert into test(id,counter) values(10,49 )
insert into test(id,counter) values(11,53 )
insert into test(id,counter) values(12,58 )
select a.id, b.counter - a.counter
from test a
,test b
where a.id = b.id -1
给你例子,你看看是不是你想要得。 |
|