筛选多条记录中的连续数据
来源:互联网 发布:淘宝客加权重吗 编辑:程序博客网 时间:2024/04/29 22:40
create table test
(
[min] int,
[max] int
)
insert into test select 1, 5
insert into test select 6, 10
insert into test select 11, 15
insert into test select 20, 30
insert into test select 40, 50
insert into test select 51, 60
--语句
select [min],[max] = (select min([max]) from test t1
where [max]>t2.[min] and not exists(select 1 from test where [min] = t1.[max]+1)
)
from test t2
where not exists(select 1 from test where [max] = t2.[min]-1)
--结果
1 15
20 30
40 60
- 筛选多条记录中的连续数据
- sql语句查找记录中的连续数据
- 统计每条记录中的最大连续值
- 产生10000条连续记录
- 产生10000条连续记录
- DataTable中的数据筛选
- 筛选DataTable中的数据
- 筛选列表中的数据
- 筛选第m到n条记录
- 筛选分组的第一条记录
- 数据库中多条记录有相同数据,可以用函数筛选只查询相同记录中的一条
- Excel中的数据筛选和高级筛选
- 提取第50~60条记录(数据id不连续)
- 用SQL查询Table中的第31条到40条记录(考虑不连续情况)
- 删除两条相同数据中的其中一条记录
- 删除DataTable中的多条记录
- mysql 单条insert语句,插入多条数据记录
- 删除grid中的一条记录或者多条记录
- 新申请的空间和域名www.aspneter.cn
- 2006 XML TOP 10!
- C# 避免程序重复启动(二次启动)
- mysql两个表结构相同,如何找出它们的不同记录方法[left join].
- 乌龟的“规定”
- 筛选多条记录中的连续数据
- WebSphere Business Modeler 认证考试 990 准备: 第 1 部分,业务流程建模
- boost库的常用组件的使用
- Cisco 设备配置ssh(Security shell)登录
- UPS FedEx DHL TNT
- 一个典型的Hibernate多对一关联配置
- open source project&tool I concern
- Rational Edge 电子月刊中文版 2007 年第 2 期
- 编程修养