A表和B表已经左连接查询了,现在又要添加一个C表,C表的user_id等于A表invite_admin_id,我怎么查询才能在A表查询出来数据里面的invite_admin_id对应上C表的name名?求指导,以下是原sql语句
SELECT i.invite_id, i.invite_parent_id, u.user_id, u.user_name, u.email, u.is_validated, u.mobile_phone, IFNULL(p.user_name,‘admin’) AS invite_name FROM ‘B’ u,‘A’ i LEFT JOIN ‘B’ p ON i.invite_parent_id = p.user_id WHERE i.u_id = u.user_id AND i.is_dispose = 0
明白了,我试一试