Loading

MySQL子查询结果集是否有记录

Mark

SELECT
    tu.id userId,
    tu.avatar_url avatarUrl,
    tu.wx_nick_name wxNickName,
    tu.city city,
    (select dict_label from sys_dict_data where dict_type = 'sys_user_sex' and dict_value = tu.sex) sex,
    if(1 = (select 1 from sys_user where phonenumber = tu.mobile limit 1), '代理', '用户') userDesc
FROM
    t_wx_user tu

:)

posted @ 2019-06-27 14:22  dai.sp  阅读(1509)  评论(0编辑  收藏  举报