现在的位置: 首页 > 综合 > 正文

mysql join总结

2013年10月07日 ⁄ 综合 ⁄ 共 301字 ⁄ 字号 评论关闭

 

内连接:[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

抱歉!评论已关闭.