mysql关联查询
2020-01-13 本文已影响0人
大雨滂沱在关外
select * from tab1 t;
image.png
select * from tab2 t;
image.png
select * from tab1 t left join tab2 on t.a = tab2.a;
select * from tab1 t right join tab2 on t.a = tab2.a;
select * from tab1 t cross join tab2 on t.b = tab2.b;
select * from tab1 t inner join tab2 on t.b = tab2.b;
select * from tab1 t left outer join tab2 on t.a = tab2.a;
select * from tab1 t right outer join tab2 on t.b = tab2.b;
select * from tab1 t natural join tab2;
select * from tab1 t join tab2 on t.a = tab2.a;