插入某些列 [英] Insert into certain columns

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

问题描述

我使用的是 SQL Server 2005.

Im using SQL Server 2005.

我有一个包含 3 列的 table1.和 table2 有 4 列.

I have a table1 with 3 columns. And table2 with 4 columns.

我想将 table1 中的记录插入 table2.

I want to insert the records from table1 into table2.

但我不想从 table2 插入 column1.

But I dont want to insert into column1 from table2.

我想从第 2 列开始插入.

I want to start inserting from column2 on.

我能做什么?谢谢...

What can i do? Thanks...

推荐答案

insert into table2
(
    col2, col3, col4
)
select col1, col2, col3
from table1

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

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