我想将此查询的结果集插入到存储过程中的临时表中。
select * from A
union all
select * from B
union all
select * from C
答案 0 :(得分:3)
SELECT *
INTO #SomeTempTable
FROM (SELECT *
FROM A
UNION ALL
SELECT *
FROM B
UNION ALL
SELECT *
FROM C) D
答案 1 :(得分:2)
请尝试以下:
Insert Into #Temp
select * from A
union all
select * from B
union all
select * from C