常常会碰到这样的场景,将表的数据按照必定的查询条件查询出来以后,将结果放到一块儿显示,这个时候,就须要用到union,和union all关键字来实现这样的功能,web
select * from t1 union | union all select * from t2 union | union all select * from tn
select deptno from emp union all select deptno from dept;
select deptno from emp union select deptno from dept;