表连接 内连接
select 列1,列2 from 表1,表2where 表1.列1= 表2.列1;
左链接
select 列1,列2 from 表1 left join 表2 on 表1.列1 = 表2.列1;
右链接
select 列1,列2 from 表1 right join 表2 on 表1.列1 = 表2.列1;
子查询 in not in = != exists not exists
select * from 表1 where 列1 in(select 列1 from 表2);
两个表或多个表的查询结果 需要联合 union union all
select 列1 from 表1 union select 列1 from 表2;
select 列1 from 表1 union all select 列1 from 表2;【不去重】