-- 左连接
select *
from t1 left join t2 on key1=key2;
-- 右连接
select *
from t1 right join t2 on key1=key2;
-- 左反连接
select *
from t1 left join t2 on key1=key2
where key2 is null;
-- 右反连接
select *
from t1 right join t2 on key1=key2
where key1 is null;
-- 纵向合并
select * from t1
union
select * from t2;
select * from t1
union all
select * from t2;
在第一节基础上 更新了函数和执行顺序:实操了字符数函数、时间函数、字段截取函数、interval函数等,除最后顺序实操因未导入数据库,导致无法执行