Sql语句求最小可用id
编程学习 2021-07-05 16:49www.dzhlxh.cn编程入门
select id from test a where not exists
(
select 1 from test where id=a.id+1
)
order by id
缺点,不从1开始计算。
(
select 1 from test where id=a.id+1
)
order by id
缺点,不从1开始计算。