# 笛卡尔积
SELECT * FROM dept,emp
# 内连接
SELECT * FROM dept INNER JOIN emp ON dept.`did`=emp.`edid`
#另一中写法
SELECT * FROM dept,emp WHERE dept.`did`=emp.`edid`
#左外连接
SELECT * FROM dept LEFT JOIN emp ON dept.`did`=emp.`edid`
# 右外连接
SELECT * FROM dept RIGHT JOIN emp ON dept.`did`=emp.`edid`
#A or B表独有的
SELECT * FROM dept RIGHT JOIN emp ON dept.`did`=emp.`edid`
WHERE dept.`did`IS NULL
#A和B全都有
SELECT * FROM dept LEFT JOIN emp ON dept.`did`=emp.`edid`
UNION
SELECT * FROM dept RIGHT JOIN emp ON dept.`did`=emp.`edid`

