SELECT rc.*,u.username'inviterName'
FROM rc_user rc
LEFT JOIN rc_user u
ON rc.inviter=u.id
WHERE rc.income>1000;
SELECT rc.*,u.username'inviterName'
FROM rc_user rc
INNER JOIN rc_user u
ON rc.inviter=u.id
AND rc.income>1000;
inner join 的sql语句可以用and直接连接筛选条件,但left join 必须加where筛选。