当前位置:Gxlcms > 数据库问题 > 180.Mysql之连续出现的数字

180.Mysql之连续出现的数字

时间:2021-07-01 10:21:17 帮助过:14人阅读

   2. 使用Having判断出现连续出现数字的次数和大于等于3
select l2.Num from Logs as l1
inner join (select distinct(Num) from Logs) as l2 on l1.Num = l2.Num
having sum(if(l1.Num >= l2.Num, 1, 0)) >= 3

 

 

180.Mysql之连续出现的数字

标签:color   使用   关联表   mysql   解决方案   关联   tin   ons   方案   

人气教程排行