MySQL join 用法

select column1, column2 from TABLE1 join TABLE2 on 条件

#
select * from table1 join table2;
#两个表合成一个
select a.*, b.* from a left join b where a.id=b.id limit 0,1;

 

on 条件 where/ group by / having/ 
除了on的条件, 还能加where等条件

 

除了join还有:
left join 左表为准
right join 右表为准
inner join 交集

用法差不多

 

posted on 2017-06-24 14:50  Perl6  阅读(428)  评论(0编辑  收藏  举报

导航