数据库其它

关注公众号 jb51net

关闭
首页 > 数据库 > 数据库其它 >

Sql语句求最小可用id

作者:

Sql语句求最小可用id
select id from test a where not exists 

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

order by id 
缺点,不从1开始计算。
阅读全文