Sort the output of querying by value or alpha.