当前位置:数据库 > MySQL >>

Mysql 查询不连续ID 不连贯id编号sql代码

由于一些特殊原因丢失了 部分数据,现在需要查询出来不连贯的id也就是被删除的id编号的sql代码

select id from (select id from yizuotu.net order by id asc) t where not exists (select 1 from yizuotu.net where id=t.id-1)

有需要就试试吧

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
访问www.zzzyk.com 试试
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,