Ik have a table with route information in random order, like this:
from to street
----------------------------------
92 91 Lange Poten
100 104 Bagijnestraat
85 79 Korte Poten
91 85 Plein
79 100 Bezuidenhoutseweg
I’m trying to find a method to sort it using the route information, where the to column of the current row matches with the from column of the next row. In the example, the order I want is:
from to street
----------------------------------
92 91 Lange Poten
91 85 Plein
85 79 Korte Poten
79 100 Bezuidenhoutseweg
100 104 Bagijnestraat
A simple ORDER BY on the from or to column doesn’t work because a numerical order isn’t the right one. I’m trying to find a method using SQL or Excel.
SQL Fiddle here: http://sqlfiddle.com/#!2/9ebbb
This works in oracle