首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

关于临时表的有关问题

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

关于临时表的问题
我先有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

热点排行