I have a table with the following columns
table: route
columns: id, location, order_id
and has meanings such as
id, location, order_id
1, London, 12
2, Amsterdam, 102
3, Berlin, 90
5, Paris, 19
Is it possible to make a sql select statement in postgres that will return every row along with id with the next highest order_id? So I want something like ...
id, location, order_id, next_id
1, London, 12, 5
2, Amsterdam, 102, NULL
3, Berlin, 90, 2
5, Paris, 19, 3
thank