You could use client side sorting for this - see this quick demo I put together: QueryTask - client side sorting
Basically, you just use the array.sort method with an anonymous function:
results.features.sort(function(a, b) {
// return a.attributes.POP2007 - b.attributes.POP2007; // ascending
return b.attributes.POP2007 - a.attributes.POP2007; // descending
});
In your case replace the POP2007 field name with COD to sort the features.