in reply to Re^3: Sort in multilevel hash
in thread Sort in multilevel hash

The problem is to combine ORDER BY and JOIN. Wherever I put it in the query I get syntax error... I am not sure exactly what the join is making so I have not dared to change it into some other query...

Replies are listed 'Best First'.
Re^5: Sort in multilevel hash
by roboticus (Chancellor) on Jan 09, 2012 at 11:00 UTC

    queriniere:

    Try wrapping your SQL query inside another, and sort the outer one, something like:

    select foo, bar, baz from ( select 'a' as foo, 'b' as bar, 'c' as baz from dual union select 'f', 'q', 'z' from dual union select 'x', 'y', 'z' from dual ) order by bar

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^5: Sort in multilevel hash
by Anonymous Monk on Jan 09, 2012 at 09:51 UTC

    ORDER BY must be after WHERE (or GROUP BY or HAVING) of the last statement. You effectively have multiple statements thanks to the unions.

Re^5: Sort in multilevel hash
by Anonymous Monk on Jan 09, 2012 at 09:55 UTC
    append means add to the end :)