#两种方式:if和when #if #select customer_id,gender,city,country,age,latest_place_order_date from `customers_info` order by (if(city is not null,city,country)) #when select customer_id,gender,city,country,age,latest_place_order_date from `customers_info` order by (case when city is null then country ...