SELECT DISTINCT
(
CASE
WHEN t.fromType = ''
THEN '关羽'
WHEN t.fromType = ''
THEN ' 张飞'
WHEN t.fromType = ''
THEN ' 赵云'
WHEN t.fromType = ''
THEN ' 马超'
WHEN t.fromType = ''
THEN ' 黄忠'
WHEN t.fromType = ''
THEN ' 魏延'
ELSE ' 其他'
END
) 注册来源
FROM
tb_userInfo t
结果如下: