0
How can I select all rows next to the row matching with the condition?
This is the table structure with 10 rows, but the number of rows increase in the future.
Table structure 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
9 DateTime 3
10 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
9 DateTime 3
Not working for me, it shows IDs(1,4,8,10) Where the N1=9, read my latest comment in the question – Martini002 – 2017-04-11T00:12:20.883
I will try it again in my MySQL server, just to confirm a misstype from my part, but the first attempt did not work for me, give me a moment please – Martini002 – 2017-04-11T00:28:10.303
I know why it was not working,
Select * FROM t1;
it is present in your 3th line hahaha, works as expected, many thanks to you – Martini002 – 2017-04-11T00:31:32.560But, if the
RowID
is not secuential? If I deleteID 5
it can not show theRowID 6
– Martini002 – 2017-04-11T00:52:11.827