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

:)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM