代码:
select A as AB from tableA union all select distinct B from tableB;
添加条件:字段唯一显示
select distinct A as AB from tableA union all select distinct B from tableB;
添加条件:字段唯一显示,字段递减
select distinct A as AB from tableA union all select distinct B from tableB order by AB asc;
添加条件:字段唯一显示,字段递减,过滤重复
select distinct A as AB from tableA union select distinct B from tableB order by AB asc;
原文:https://www.cnblogs.com/shuoguoleilei/p/13304733.html