你groupby某列 count(1)这样能得到统计数据,
你的需求看不太懂``
希望查某值出现多次到必须是连续出现的记录
@小柑: Row number()这个可以满足你的要求
使用group by语法分组,详情:http://www.cnblogs.com/rainman/archive/2013/05/01/3053703.html
select *,identity(int,1,1) as ID into #t from tablename
select a.* from #t as a left join #t as b on a.某列=b.某列 and a.ID=b.ID+1 where b.某列 is not null
drop table #t
select * from [表名] where [列名] = [固定值]
能不能贴个具体的然后帮你写啊