Sort columns so that primary key is first.