mysql 断号查询

作者: admin 分类: 乱7八糟 发布时间: 2012-08-03 17:16 ė 6 没有评论

select id1,(select min(id)-1 from news where id>id1) as id2 from (select id+1 as id1 from news where id+1 not in (select id from news ) and id <(select max(id) from news )) as cc; news 是表名称 id 是字段的名称 1 2 3 4 5 19 20 21 自动打印出中间断号的ID

本文出自 小Q,转载时请注明出处及相应链接。

本文永久链接: http://www.linuxqq.com/archives/877.html

0
更多
Ɣ回顶部