从一个表查询出多条数据插入另外一个表

阅读更多
INSERT INTO "YANG"."tb_mrt_rpt_bass_d022" 
(
select "deal_date","city_code","city_name",'' region_code,'' region_name,'' sm_code,'' sm_name,"ret_num",'' ret_num1,'' ret_num2,'' ret_num3 from "tb_mrt_rpt_bass_d022_copy"
)

要指定列名

有时这样会神奇的报错,解决办法 嵌套一个 select *

INSERT INTO "YANG"."tb_mrt_rpt_bass_d022" 
select * from (
select "deal_date","city_code","city_name",'' region_code,'' region_name,'' sm_code,'' sm_name,"ret_num",'' ret_num1,'' ret_num2,'' ret_num3 from "tb_mrt_rpt_bass_d022_copy"
)
)

你可能感兴趣的:(从一个表查询出多条数据插入另外一个表)