如果是面试就直接这么答吧。 这个答案并不严密完整。 另外还要考虑 被删除 id连续的情况。 select id-1 from 有一mysql表 t where not exists (select 1 from 有一mysql表 where id=t.id-1) and id>1
56,679
社区成员
56,709
社区内容
加载中
试试用AI创作助手写篇文章吧