- 内连接
join 和 inner join没有区别,一样的意思 :表示交集
select * from A inner join B on 条件
等价于
select * from A join B on 条件
- 左连接
select * from A left join B on 条件
- 右连接
select * from A right join B on 条件
- 左表独有数据
select * from tableA A Left Join tableB B on A.Key = B.Key where B.key IS NULL
- 右表独有数据
Select from tableA A Right Join tableB B on A.Key = B.Key where A.key IS NULL
- 全连接:表示并集
将左连接和右连接联合起来作为全连接
select * from A left join B on A.ID= B.ID
union
select * from A right join B on A.ID = B.ID
- 左右表各自独有数据:
Select from tableA A Full Outter Join tableB B on A.Key = B.Key where A.key = null or B.key=null