mysql join总结

来源:互联网 发布:qq炫舞刷装备软件2016 编辑:程序博客网 时间:2024/05/16 14:16
 

内连接:[inner|cross] join (不带innercross时也值内连接)

 

外连接:

               左外连接:left [outer] join

               右外连接:right [outer] join

 

错误语法:

              outer join

              full outer join

 

mysql不支持全连接

         全连接实现方法

  

select a.*,b.* from a left join b on a.id=b.id

union

select a.*,b.* from a right join b on a.id=b.id and a.id is null

原创粉丝点击