Consider a table with a column that reffers to another line of the same table:
| id | previous_id | next_id |
------------------------------------
| 10 | | 11 |
| 11 | 10 | 12 |
...
| x | y | |
The ids aren't always chained in sequence.
How do I query the next line until the next_id is null?
Is it possible to use while inside where?