select * from tb order by case 所在城市 when '合肥' then 1 when '上海' then 2 when '' then 3 when '南京' then 4 end 数值越小越靠前