将数据插入临时表 [英] Inserting data into a temporary table

查看:31
本文介绍了将数据插入临时表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建临时表并像这样声明数据类型之后;

After having created a temporary table and declaring the data types like so;

CREATE TABLE #TempTable(
ID int,
Date datetime,
Name char(20))

然后如何插入已保存在数据库中物理表中的相关数据?

How do I then insert the relevant data which is already held on a physical table within the database?

推荐答案

INSERT INTO #TempTable (ID, Date, Name) 
SELECT id, date, name 
FROM physical_table

这篇关于将数据插入临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆