Sql语句求最小可用id

来自:网络
时间:2021-05-28
阅读:
免费资源网 - https://freexyz.cn/
select id from test a where not exists 

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

order by id 
缺点,不从1开始计算。
免费资源网 - https://freexyz.cn/
返回顶部
顶部