阅读背景:

mysql查询表中最小可用id值

来源:互联网 

今天在看实验室的项目时,碰到的一个问题,。先把sql语句扔出来

// 这条语句在id没有1时,不能得到正确的查询结果。
select min(id+1) from oslist c where not exists (select id from oslist where id = c.id+1);// 这条语句在id没有1



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: