1
How can I select all rows next to the row matching with the condition? But considering there is not a secuential RowID like ID Field
This is the table structure with 10 rows, but the number of rows will increase in the future.
Plain text:
ID Date N1
1 DateTime 9
2 DateTime 2
3 DateTime 5
4 DateTime 9
5 DateTime 3
6 DateTime 6
7 DateTime 7
8 DateTime 9
20 DateTime 3 //Sequence broken
21 DateTime 9
Note: The "DateTime" string it's just symbolic, it would be any DateTime.
I am trying to know the first N1 number after the number: 9
I tried several ways but the result is not what I need.
The expected result is:
ID Date N1
2 DateTime 2
5 DateTime 3
20 DateTime 3
A simple way to achieve this was posted in this question, but only if the RowID keep the sequence.