mysql的join

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

posted on 2014-04-10 00:17  sangbiao  阅读(153)  评论(0编辑  收藏  举报