I will try to make it clear.
I need to select a specific row and one row of the previous sibling from this selected row and one row of the next sibling from this selected row without using an identifier. Is it possible? Below and below, in short.
The reason I can't (maybe just don't know how) to use identifiers is because they are not in sequential order. They have gaps, as you can see from this rather immature and random example.
TABLE <-the name of the table
+----+----------------------+-------+
| id | name | value |
+----+----------------------+-------+
| 1 | some_name | asf |
+----+----------------------+-------+
| 4 | hello | A3r |
+----+----------------------+-------+
| 5 | how_do_you_do | HR5 |
+----+----------------------+-------+
| 8 | not_bad | 00D |
+----+----------------------+-------+
| 12 | i_like_women | lla |
+----+----------------------+-------+
| 13 | are_you_serious | 1Ha |
+----+----------------------+-------+
| 15 | nah_i_kid | Ad4 |
+----+----------------------+-------+
| 17 | it_is_just_the_boobs | Zc5 |
+----+----------------------+-------+
| 18 | thank_god | 102 |
+----+----------------------+-------+
| 44 | no_kidding | jjy |
+----+----------------------+-------+
First, I need to select one row based on a specific value from one of its columns. I know how to do this:
SELECT `value`
FROM `TABLE`
WHERE name = 'i_like_women'
This will select one row with id 12 with the value lla.
: "not_bad" "are_you_serious" . , , .
, . , MySQL.
. , .