首页 > 数据库技术 > 详细

SQLServer从渣仔到小白

时间:2019-12-12 21:45:29      阅读:95      评论:0      收藏:0      [点我收藏+]

一、将查询结果插入到另一张表

1. 查询结果插入新表

select * into tableA from tableB where …

2. 查询结果插入已经存在的表

insert into tableA
select * from tableB where…

3. 查询结果跨数据库

insert into schemaA.tableA
select * from schemaB.tableB where…

4.查询结果加上新字段插入已经存在的表

insert into tableA
select *,NULL from tableB where…  

SQLServer从渣仔到小白

原文:https://www.cnblogs.com/beiyi888/p/12031314.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!