180_Consecutive Numbers
+----+-----+
| Id | Num |
+----+-----+
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 1 |
| 6 | 2 |
| 7 | 2 |
+----+-----++-----------------+
| ConsecutiveNums |
+-----------------+
| 1 |
+-----------------+Solution 1: Use INNER JOIN
Solution 2: Use Subquery
Last updated