Sort by code and value