insert into tableA_name(字段名……)(select column_name as 别名…… from tableB_name)
将B表查出来的数据插入到A表中,注意注意B表的别名要一一对应A表字段名,要一模一样。
这个方法只适应在同一数据库中的存在的两张表操作。
sql从一个表中查的数据,插入到另一个表中
最新推荐文章于 2024-06-11 16:45:11 发布
insert into tableA_name(字段名……)(select column_name as 别名…… from tableB_name)
将B表查出来的数据插入到A表中,注意注意B表的别名要一一对应A表字段名,要一模一样。
这个方法只适应在同一数据库中的存在的两张表操作。