sql语句查询结果合并union 和union all用法
--合并重复行select * from Aunionselect * from B--不合并重复行select * from Aunion allselect * from B按某个字段排序--合并重复行select *from ( select * from A union select * from B) AS Torder by 字段名--不合并重复行select *from ( select * from A union all select * from B) AS Torder by 字段名在DB2里使用union时一定要注意相对应的字段一定是数据类型一样,输出时可以任意显示的列,但不能输出不同类型或不同表结构。因为这样会出错。?