题目链接如下: https://leetcode.com/problemset/database/
目录
601. Human Traffic of Stadium
和前面有一题类似,求超过连续3天客流量大于100的记录
# Write your MySQL query statement below
select distinct a.* from
stadium a,stadium b,stadium c
where (a.people>=100 and b.people>=100 and c.people>=100)
and (
(a.id+1=b.id and a.id+2=c.id) or
(a.id-1 = b.id and a.id+1 = c.id)or
(a.id-2=b.id and a.id-1=c.id)
)
order by a.id;