日期:2014-05-18 浏览次数:20914 次
1,if(select max(no)-min(no)+1 from tb)=(select count(*) from tb)
print '连续'
2,if(select max(no)-min(no)+1 from tb)=(select count(*) from tb) and select min(no) from tb)=1
print '从1开始连续'
3,select number from master..spt_values
where type='p'
and not exists(select 1 from tb where no=number)
and number<(select MAX(no) from tb)