601. 体育馆的人流量
Posted letlifestop
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了601. 体育馆的人流量相关的知识,希望对你有一定的参考价值。
601. 体育馆的人流量
暴力搜索条件
一开始不知道怎么去重,然后看了一眼评论区就行白了,直接 select s1.* 就可以对全表的数据进行去重
# Write your mysql query statement below select distinct s1.* from stadium s1, stadium s2, stadium s3 where (s1.id + 1 = s2.id and s2.id + 1 = s3.id and s1.people >= 100 and s2.people >= 100 and s3.people >= 100) or (s1.id - 1 = s2.id and s2.id - 1 = s3.id and s1.people >= 100 and s2.people >= 100 and s3.people >= 100) or (s1.id - 1 = s2.id and s1.id + 1 = s3.id and s1.people >= 100 and s2.people >= 100 and s3.people >= 100) order by visit_date asc ;
以上是关于601. 体育馆的人流量的主要内容,如果未能解决你的问题,请参考以下文章