当前位置:主页 > >

Sql语句求最小可用id

时间:2020-11-07 21:54:14 | 栏目: | 点击:

select id from test a where not exists 

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

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

您可能感兴趣的文章:

相关文章