FAIRYFAR-INTERNAL
 
  FAIRYFAR-INTERNAL  |  SITEMAP  |  ABOUT-ME  |  HOME  
您的足迹: MySQL Full Join等价改写
MySQL Full Join等价改写

MySQL Full Join等价改写

MySQL不支持Full Join,可以这样改写:

snippet.bash
select * from t1 full join t2 on t1.id = t2.id;

等价改写 ⇒

snippet.bash
select * from t1 left join t2 on t1.id = t2.id
union all
select * from t1 right join t2 on t1.id = t2.id where t1.id is null;


打赏作者以资鼓励:
移动端扫码阅读: