case-then (类似其他语言 if else) SELECT *, ( CASE WHEN address = '' THEN 100 WHEN address is null THEN 100 ELSE sort END ) AS score FROM a_shop ORDER BY score desc, id ASC