如何创建临时表,把查询结果导入到临时表中 如何创建临时表,把查询结果导入到临时表中? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * into #tmp from tb where ... select *into #from oldtable --orcreate table #()insert #selec * from oldtable create table #tb(..)insert into #tb select * from tb1 方法一:create table tbinsert into #tmpselect * from tb where ......方法二:select * into #tmp from tb where .... --第一种create table #temp(col1 int)--第二种select * into #temp from table1 --第一种 表结构已定create table #temp(col1 int)insert into #tempselect * from tablename--第二种 临时表和 结果表一样select * into #temp from table1 求助查询最大日期的销售商品 关于DATEDIFF的一个问题 存储过程中的逻辑问题,进者有分 想写一个insert触发器。 急:为什么我的sql数据库可以读出来,但不能写入! 散分 求助:几个关于触发器的问题 请问在SQL Server2000中如何从系统存储过程的结果集取值? 求助 求助,游标必须声明变量的错误 急求一个查询语句! 用很多存储过程会影响SQL服务器效率吗?
into #
from oldtable
--or
create table #()
insert #
selec *
from oldtable
create table tb
insert into #tmp
select * from tb where ......
方法二:
select * into #tmp from tb where ....
--第一种
create table #temp(col1 int)
--第二种
select * into #temp from table1
--第一种 表结构已定
create table #temp(col1 int)insert into #temp
select * from tablename--第二种 临时表和 结果表一样
select * into #temp from table1