i have a query that is order by alphabetical order
select id, color_name from colors order by color_name
output
| 4 | blue | 1 | red | 2 | violet | 3 | yellow
i want to query the before and after record of specific record. example: red
desired output:
| 4 | blue | 1 | red | 2 | violet
thanks.
Try using a UNION: