插入临时表
如下面的代码
Select ID,Color from TrimPO_InputData where HeadID=1
Union all
Select ID,Color from TrimPO_InputData where HeadID=1
Union all
Select ID,Color from TrimPO_InputData where HeadID=1
请问该如何才可以插入一张临时表?
在线等,请不吝赐教!
[解决办法]
select * into #tmp from
(
Select ID,Color from TrimPO_InputData where HeadID=1
Union all
Select ID,Color from TrimPO_InputData where HeadID=1
Union all
Select ID,Color from TrimPO_InputData where HeadID=1) a
[解决办法]
呵呵,总之就是,不用特意去建立临时表,可以直接select * into #临时表名称 from 表