SELECT * FROM a LEFT JOIN b ON a.aID = b.bID; a为主,a的数据全显示,连不上b的对应字段为空
SELECT * FROM a RIGHT JOIN b ON a.aID = b.bID; b为主,b的数据全显示,连不上a的对应字段为空
SELECT * FROM a INNER JOIN a ON a.aID = b.bID; 相当于where a.aID=b.bID
SELECT * FROM a LEFT JOIN b ON a.aID = b.bID; a为主,a的数据全显示,连不上b的对应字段为空
SELECT * FROM a RIGHT JOIN b ON a.aID = b.bID; b为主,b的数据全显示,连不上a的对应字段为空
SELECT * FROM a INNER JOIN a ON a.aID = b.bID; 相当于where a.aID=b.bID