1: 局部臨時表#temp select * into #temp from Utable where ......2: 全局臨時表##temp select * into ##temp from Utable where ......3: 表變量 @temp (used in SQL 2000) declare @temp table (a int,...........) insert into @temp select * from Utable where .......
select * into #aaa from 表1
select col1,col2..... into #tab from tab
COMPUTE 生成多个结果集.可以用GROUP BY。 select coll,col2.... into #temp from tab group by ...
select * into #temp from Utable where ......2: 全局臨時表##temp
select * into ##temp from Utable where ......3: 表變量 @temp (used in SQL 2000)
declare @temp table (a int,...........)
insert into @temp
select * from Utable where .......
select coll,col2.... into #temp
from tab
group by ...