日期:2014-05-17 浏览次数:20439 次
select a,b,c into #tb from table union select a,b,c into #tb2 from table2
select a,b,c into #tb from table select a,b,c into #tb2 from table2 select * from #tb union select * from #tb2
------解决方案--------------------
select a,b,c into #tb from table 是创建表并且插入数据,并不是查询结果
而union 是取那个结果集的并集 ,所以不能这样写
------解决方案--------------------
select a,b,c into #tb from table select a,b,c into #tb2 from table2 select * from #tb union all --不过滤重复数据了 select * from #tb2
------解决方案--------------------
不能带着into 进行 union。