Combine sort conditions