比如搜索张三同学,如果有张三,则显示在第一位,如果没有则搜索张
select id,name,(CASE WHEN NAME = '' THEN 1 ELSE 0 END) AS xx where name like '张%' ORDER BY xx desc