2020-02-19
阅读量:
855
mysql中几种连接的写法
-- 左连接
select *
from t1 left join t2 on key1=key2;
-- 右连接
select *
from t1 right join t2 on key1=key2;
-- 左反连接
select *
from t1 left join t2 on key1=key2
where key2 is null;
-- 右反连接
select *
from t1 right join t2 on key1=key2
where key1 is null;
-- 纵向合并
select * from t1
union
select * from t2;
select * from t1
union all
select * from t2;






评论(0)


暂无数据
推荐帖子
0条评论
1条评论
0条评论