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