找出ID不连续的记录,偶没思路了
--测试数据
create table table_test
(
id int ,
name Varchar(50)
)
insert into table_test
select 1,'A'
union all
Select 2,'B'
union all
Select 3,'C'
union all
Select 11,'S'
union all
Select 12,'Q'
union all
Select 15,'W'
union all
Select 17,'Q'
union all
Select 19,'Z'
--Select * from table_test
输出结果为
id name
----------- --------
3 C
11 S
12 Q
15 W
17 Q
19 Z
11, 12 虽然连续, 但 3,11 不连续, 12,15 不连续, 所以 11,12 也要 输出