http://expert.csdn.net/Expert/topic/1131/1131325.xml

解决方案 »

  1.   


            select isnull(min(a+1),1) from  (select a from test_inc  union select 0  from test_inc) t where not exists (select 1 from test_inc where t.a+1 =test_inc.a)对于表
    test_inc 查字段a的空缺
      

  2.   

    找出多个空缺:
    http://expert.csdn.net/Expert/topic/1021/1021698.xml?temp=.9253351
      

  3.   

    找多个空缺:
    http://expert.csdn.net/Expert/topic/1021/1021698.xml?temp=.9253351