select * from A
union
select * from B --不合并重复行
select * from A
union all
select * from B --如果要对字段进行排序
select *
from (
select id,... from A
union all
select id,... from B
) t
order by ID
相关文章
- SQL Server 使用union all查询多个条件数据合并分组显示,同比统计
- Union all的使用实现一条sql把不同表里面的数据查出来,或者按照不同的查询条件查出来的sql累加起来
- Sql Server 存储过程中查询数据无法使用 Union(All)
- SQL Server 使用union all查询多个条件数据合并分组显示,同比统计
- sql 查询结果合并union all用法_数据库技巧
- Sql Server 存储过程中查询数据无法使用 Union(All)
- SQL如何把两个表的数据合成一张表,用左联与UNION ALL
- Union all的使用实现一条sql把不同表里面的数据查出来,或者按照不同的查询条件查出来的sql累加起来