I have a problem with a SQL Statement. For example : I have 10 Rows in the database with the ID 1 to 10.
The main row is selected by date. Then 3 other rows should be selected. 1 row above the main one and 2 below the main row, and they aren't selected by date. The "TOP" syntax doesn't work really here and the question is, if there is a possibility to realize this in one SELECT statement only.
The main row is selected by date. Then 3 other rows should be selected. 1 row above the main one and 2 below the main row, and they aren't selected by date. The "TOP" syntax doesn't work really here and the question is, if there is a possibility to realize this in one SELECT statement only.