侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

insert into select和select into的使用和区别介绍

2022-06-01 星期三 / 0 评论 / 0 点赞 / 176 阅读 / 776 字

insert into ... select ...:可将表1中的全部数据或者部分数据复制到表2中。 eg: 复制代码 代码如下: insert into t2(id,name,pwd) select id,name,p

insert into ... select ...:可将表1中的全部数据或者部分数据复制到表2中。

eg:

复制代码 代码如下:.

insert into t2(id,name,pwd)
select id,name,pwd from t1
.
注:t2必须存在。t1中查询的列名可不与t1列名相同。无 values

select...into:查询t1中的数据,插入到t2中。

eg:
复制代码 代码如下:.

select * into t2 from t1
.
注:t2被创建并填充数据。

广告 广告

评论区