How can I write a query to transform a list of numbers into 2 columns.
e.g. I have a table with an ID column with values (3, 6, 9, 12, 15, 18).
I would like a result that looks like
ID NEXT_ID
3 6
6 9
9 12
12 15
15 18
Note that this should work for any sequence of id's not necessarily multiples of 3.
I am working on Oracle 11.2