日期:2014-05-18  浏览次数:20345 次

关于临时表的问题
我先有2张表   表1有一个价格,其中值是输入.   表2也有一个价格,它是由公式生成的.

如何做一张临时表,把这两张表查的到的价格填充到临时表的价格当中去.

------解决方案--------------------
select 价格 into # from
(
select 价格 from 表1
union all
select 价格 from 表2
)a
------解决方案--------------------
create table #tmp(price decimal(18,1))
insert #tmp select price from 表1 union all select price from 表2
select * from #tmp
go
------解决方案--------------------
create table #tmp(price decimal(18,1))
insert #tmp select price from 表1 union all select price from 表2
select * from #tmp
go


------解决方案--------------------
select price into #temp from 表1 union all select price from 表2
select * from #tmp