MySql插入数据

方法1:创建表,添加字段,插入数据

create temporary table test (id2 nvarchar(130),id17 nvarchar(40));
insert into test (id2,id17) values('testid201','testid1701');
insert into test  values('testid202','testid1702');

 

方法2:insert into 表明 select 字段名from 表名

insert into test2 select id2,product_name from bs_jdi_product_label where update_at<'2019-06-15 09:39:32';

方法3:replace into 表名 字段名 select 字段名 from 表名

REPLACE INTO rtm_port(machine_name, name, area_name, factory_name, port_type)
  (SELECT
      sm.machine_name,
      sm.name,
      sm.area_name,
      sm.factory_name,
      sm.port_type
    FROM spe_port sm
    WHERE sm.check_state = 'CheckIn');

  

但愿人长久 千里共婵娟
原文地址:https://www.cnblogs.com/hellcats/p/11262419.html