1. inner join 内连接查询
SELECT a.*,b.* FROM table_a a INNER JOIN table_b b ON a.id=b.id
2. left join 左关联查询
以左表作为基础表去关联右表,查询的结果为左表的子集
SELECT a.*,b.* FROM table_a a LEFT JOIN table_b b ON a.id=b.id
3.right join 右关联查询
以右表作为基础表去关联左表,查询的结果为右表的子集
SELECT a.*,b.* FROM table_a a RIGHT JOIN table_b b ON a.id=b.id
4.左连接-内连接
取左表的部分集合,但又不存在右表中
SELECT a.*,b.* FROM table_a a LEFT JOIN table_b b ON a.id=b.id WHERE b.id IS NULL
5. 右连接-内连接
取有表的部分数据,但又不存在左表中
SELECT a.*,b.* FROM table_a a RIGHT JOIN table_b b ON a.id=b.id WHERE a.id IS NULL

