sql断点查询
来源:互联网 发布:资产负债表数据来源 编辑:程序博客网 时间:2024/06/09 15:23
例如我们要进行如下查询
一个表有个自增主键id, 里面有N行数据
id 1
id 2
id 3
id 7
id 8
id 12
id 9990
id 9993
id 9994
id 9995
要查出断掉的id :4 5 6 9 10 11 ......9991 9992
查询语句为
declare @minId int
declare @maxId int
declare @count int
declare @total int
declare @i int
declare @n int
select @minId=min(id) from area
select @maxId=max(id) from area
select @total=count(1) from area
set @i=@minId set @count=0 set @n=0
while(@i<@maxId and @n<@maxId-@total)
begin
select @count=count(1) from area where id=@i
if @count=0
begin
print @i
set @n=@n+1
end
set @i=@i+1
end
- sql断点查询
- Bootstrap CSS3媒体查询断点
- 使用 Mysql 做断点记录查询
- NetBeans和xdebug插件断点查询
- sql查询
- SQL查询
- SQL查询
- sql查询
- sql查询
- sql 查询
- sql查询
- sql 查询
- 查询sql
- sql查询
- SQL查询
- SQL查询
- SQL 查询
- SQL查询
- linux 本地添加/删除软件
- 解决主窗体拖拽移动过程中DoModal出来的窗体无法收到鼠标消息问题
- P2P中的Chord算法
- 优秀程序员的十个习惯
- 觉得不错的忠告
- sql断点查询
- 黑客与画家
- libtool的作用及应用 (转载)
- STL算法交集、并集、差集
- 2011年的第一篇文章
- 几个基础的CSS效果
- 信道容量的概念
- [zz]我的Linux书架
- 微软的MHTML0day漏洞