Sql语句求最小可用id

 更新时间:2007年04月23日 00:00:00   作者:  
select id from test a where not exists 

        select 1 from test where id=a.id+1 

order by id 
缺点,不从1开始计算。

相关文章

最新评论