sql
SELECT
m.id,
m.nickname,
m.avatar,
f.remark,
//如果remark为空串则取nickname
( CASE WHEN f.remark = '' THEN m.nickname ELSE f.remark END ) show_name
FROM
friend f
LEFT JOIN member m ON f.friend_id = m.id
WHERE
f.member_id = 1
AND f.deleted = 0
ORDER BY
//按照show_name中文拼音的首字母排序
CONVERT ( show_name USING gbk )
判断是否中文
SELECT
*
FROM
friend
WHERE
remark REGEXP '[^ -~]'