表1 | 连接语句 | 表2 | 条件 | ||||
交叉连接 | 表名1 | cross | join | 表2 | |||
自然连接 | natural | join | |||||
using | using(id) | ||||||
外连接 | 左 | left | join | on | |||
右 | right | join | on | ||||
内连接 | inner | join | on | ||||
并集 | select 表1 | union | select表2 | ||||
全 | union | all | |||||
差集 | minus | ||||||
交集 | intersect |
举例
select * tb1
select * tb2
select * from tb1 union all
select * from tb2
select * from tb1 union
select * from tb2
select * from tb1 minus select * from tb2
select * from tb1 intersect select * from tb2
表关系分析