Hi I would like to get the next and previous records when i am ordering alphabetically.
So i have the following
id name
1 john
2 simon
3 luke
I am on the record luke and i want to get the next one and the previous one in alphabetical order. So my sql query would give me back john then luke.
It is easy when the value is numerical cause i would just use two statements saying give me a record greater than (less than) limit to 1 but for the life of me i cant think how i would do this aphabetically without pulling them all out.
thanks in advance for any time you spend reading this.
So i have the following
id name
1 john
2 simon
3 luke
I am on the record luke and i want to get the next one and the previous one in alphabetical order. So my sql query would give me back john then luke.
It is easy when the value is numerical cause i would just use two statements saying give me a record greater than (less than) limit to 1 but for the life of me i cant think how i would do this aphabetically without pulling them all out.
thanks in advance for any time you spend reading this.