select a form tab现在a列中数据是这样的
1
1
1
1
1
2
3
4
2
2
2
3
4
5
6
6
6怎样写where能做到只显示相同的行 比如想显示连续3个相同的行 或连续4个5个相同的行呢...
谢谢大家了
1
1
1
1
1
2
3
4
2
2
2
3
4
5
6
6
6怎样写where能做到只显示相同的行 比如想显示连续3个相同的行 或连续4个5个相同的行呢...
谢谢大家了
解决方案 »
- sql server 添加记录号
- 大家看看update型触发器究竟错哪了?
- 今天遇到复杂的sql问题
- 日期时间问题:如何将一个日期如2007-07-10后加上我指定的时间
- 请问在sql server 中写存储过程时时从v foxpro导入数据到sql server中,如何写这个存储过程?谢谢
- 表里创建有外键,现想删掉某些表的大部分数据,怎么做比较好?
- 查询条件非常复杂时,怎么提高效率?急
- 请教使用Updategrams 模板向SQLSERVER2000更新数据时不支持中文怎么办?
- 这样的存储过程怎么样?<在线等待>
- ORACLE中怎样使用快照——救命!!
- 为什么不对呢????
- sql server导入无列名excel
--> 测试数据: @tab
declare @tab table (a int)
insert into @tab
select 1 union all
select 1 union all
select 1 union all
select 1 union all
select 1 union all
select 2 union all
select 3 union all
select 4 union all
select 2 union all
select 2 union all
select 2 union all
select 3 union all
select 4 union all
select 5 union all
select 6 union all
select 6 union all
select 6
select id=identity(int,1,1),* into # from @tabselect * from
(select a,count(col)as '次数'
from(select
*,col=(select count(1) from # where id<a.id and a<>a.a)
from # a)a
group by col,a)b
where 次数=3