It is certainly possible to accumulate all the rows returned in an array (of hashes), and then sort that array by whichever hash element you like before output.
I still think what you really want to do is to have one query that returns all the data in the desired order.