有两个表,表结构都一样,我想把这两个表select *的结果集合并到一个结集中,请问如何写? 有两个表,表结构都一样,我想把这两个表select *的结果集合并到一个结集中,请问如何写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from aunion allselect * from b --不合并重复行select * from aunion allselect * from b--合并重复行select * from aunion select * from b select * from a where id not in (select id from b)unionselect * from b select * from aunion select * from b 多个表呢?是不是全部UNION ALL select * from aunion allselect * from bunion allselect * from c select * from aunion allselect * from b select * from aunion --去重复记录select * from b select * from tbunion allselect * from tb2orselect * from tbunionselect * from tb2 select * from tbunion all ---加ALL不去重复记录select * from tb2orselect * from tbunion ---------去除重复记录select * from tb2加多个表,在加UNION就行 不同数据类型转换错误 相同的代码在ssms中可以,为什么在ssis中不能执行?? MSSQL中远程IP访问限制 征求sql server 2000,2005 备份方案 问个统计的问题 用存储过程如何操作SQL SERVER 建立一个数据库和表? EXISTS使用动态sql的问题,求救..急 主从明细查询 这个SQL语句应该怎么写??????????????? 是否有办法让数据(如:Excel表)定时自动导入! 用户登陆时,如果成功同时更新用户登陆时间,不知道sql语句怎么写? 问一个统计效率问题,
union all
select * from b
--不合并重复行
select * from a
union all
select * from b
--合并重复行
select * from a
union
select * from b
union
select * from b
union
select * from b
union all
select * from b
union all
select * from c
union all
select * from b
union --去重复记录
select * from b
union all
select * from tb2orselect * from tb
union
select * from tb2
union all ---加ALL不去重复记录
select * from tb2orselect * from tb
union ---------去除重复记录
select * from tb2
加多个表,在加UNION就行