34,838
社区成员




断号的开始号
set nocount on
declare @t table(a int,b char(6),flag int)
insert @t select 1,'one',NULL
insert @t select 2,'two',NULL
insert @t select 3,'three',NULL
insert @t select 5,'four',NULL
insert @t select 6,'five',NULL
insert @t select 10,'six',NULL
insert @t select 11,'seven',NULL
select *
from @t aa
where (a - (select max(a) from @t where aa.a > a)) > 1
/*
a b flag
----------- ------ -----------
5 four NULL
10 six NULL
*/