I have a table people
id name
----+-----
54 Tango
76 Alpha
95 Radio
When displaying the records on the web those names are ordered alphabetically
Alpha, Radio, Tango
Lets say we’re viewing Radio details and want to navigate to the next (Tango) or prevoius (Alpha) record using some links.
How can I find those id's to create the needed links?
Finding next superior or inferior id won’t work.
Is this possible?
Thanks.
You can do this:
You should use the new ranking number column
rankto create those links. Then you should control the value of the parameter@nto get the previous or the next.SQL Fiddle Demo