首页 > 数据库 > 数据库其它 > Sql语句求最小可用id 2007-04-23 00:00:00 作者: Sql语句求最小可用id select id from test a where not exists ( select 1 from test where id=a.id+1 ) order by id 缺点,不从1开始计算。