sort columns for select