mysql连表查询

 select * from test1 a,test2 b where a.no=b.no;;内连接

 select * from test1 a left join test2 b on a.id=b.id;左外连接

  select * from test1 a right join test2 b on a.id=b.id;右外连接(和左连接的区别是左连接是以左边为主表,会把左边为Null也输出,右连接相反) 

内连接和外连接的区别是内连接只匹配符合条件的项,外连接为Null也会返回

 

原文地址:https://www.cnblogs.com/yzjT-mac/p/6383356.html