Amazon log systems record numerical events in sequence. An anomaly is defined as any number that appears at least three times consecutively in the log.
Write an SQL query to find all numbers that appear at least three times consecutively.
| id(INTEGER) | num(VARCHAR) |
|---|---|
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 1 |
| 6 | 2 |
| 7 | 2 |
| 8 | 2 |
| ConsecutiveNums(VARCHAR) |
|---|
| 1 |
| 2 |