热线电话:13121318867

登录
2020-03-03 阅读量: 998
MySQL如何实现左反、右反、左反 右反连接?

-- MySQL实现左反连接

select *

from t1 left join t2 on key1=key2

where key2 is null;

-- MySQL实现右反连接

select *

from t1 right join t2 on key1=key2

where key1 is null;

-- 左反+右反

select * from t1 left join t2 on key1=key2 where key2 is null

union

select * from t1 right join t2 on key1=key2 where key1 is null;

5.2566
1
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子