暴力搜索条件
一开始不知道怎么去重,然后看了一眼评论区就行白了,直接 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
;
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。