Fix order by by wrapping unions in subquery table.