56,679
社区成员
发帖
与我相关
我的任务
分享
select a.id,b.id,(select count(*) from table1 where id between a.id and b.id ) as `连续次数`
from table1 a , table1 b
where a.id<b.id
and a.type='大'
and b.type='大'
and not exists (select 1 from table1 where id between a.id and b.id and type!='大')