--可以用游标,从倒数第三行向后一行行查询。
declare @a char(10)
declare @b char(10)
declare oneCursor scroll cursor for
select * from table2
open oneCursor
fetch absolute -3 from oneCursor into @a,@b
while (@@fetch_status=0)
begin
print 'a=' + @a + ' b=' + @b
fetch oneCursor into @a,@b
end
close oneCursor
deallocate oneCursor