We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b32b0e commit ba7390dCopy full SHA for ba7390d
solution/0600-0699/0601.Human Traffic of Stadium/README_EN.md
@@ -104,4 +104,35 @@ ORDER BY 1;
104
105
<!-- solution:end -->
106
107
+<!-- solution:start -->
108
+
109
+### Solution 2
110
111
+<!-- tabs:start -->
112
113
+#### MySQL
114
115
+```sql
116
+# Write your MySQL query statement below
117
+WITH Consecutive AS (
118
+ SELECT
119
+ *,
120
+ id - ROW_NUMBER() OVER() AS id_diff
121
+ FROM Stadium
122
+ WHERE people >= 100
123
+)
124
+SELECT id, visit_date, people
125
+FROM Consecutive
126
+WHERE id_diff IN (
127
+ SELECT id_diff
128
+ FROM Consecutive
129
+ GROUP BY id_diff HAVING COUNT(*) > 2
130
131
+ORDER BY visit_date;
132
+```
133
134
+<!-- tabs:end -->
135
136
+<!-- solution:end -->
137
138
<!-- problem:end -->
0 commit comments