add sort criteria to columns joined to query