编写一个 SQL 查询以找出每行的人数大于或等于 100 且 id 连续的三行或更多行记录。返回按 visit_date 升序排列 的结果表。...('7', '2017-01-07', '199');
INSERT INTO `stadium` VALUES ('8', '2017-01-09', '188');
答案2023-01-11:
sql...- t2.id = 1 and t1.id - t3.id = 2 and t2.id - t3.id =1) -- t1, t2, t3
or
(t2.id - t1.id = 1...and t2.id - t3.id = 2 and t1.id - t3.id =1) -- t2, t1, t3
or
(t3.id - t2.id = 1 and t2.id -...t1.id =1 and t3.id - t1.id = 2) -- t3, t2, t1
)
order by t1.id