SQL语句 怎么把从一个表中查出来数据插入到另一个表中

怎么把从一个表中查出来数据插入到另一个表中 是用语句

第1个回答  推荐于2018-03-08
insert into T_annual(year,userid,username) select hryear,userid,username from T_annualleavebase where ...本回答被提问者和网友采纳
第2个回答  2018-06-28
方法如下:
insert into 表2(字段名1,字段名2,.....)
select 字段1,字段2,...
from 表1
where ...
其中字段类型必须完全符合。
第3个回答  2018-08-04
使用Insert into 目标表(字段列表) select 字段列表 from 原始表
即可实现你所说的功能。
第4个回答  2009-11-17
你要查什麼数据据?算了,我这是嵌套语句,你看著往里面换字段就可以了
insert into 表(select 条件 from 表)
第5个回答  2009-11-17
insert into tableA (col1,col2, col3)
(
select tableB.col1, tableB.col2, tableB.col3
from tableB
where ...
)