mysql连表更新和插入

mysql连表更新和插入

  • update
update A inner join(select id,name from B) c on A.id = c.id set A.name = c.name;  
  • insert
insert into A(a,b,c) select  a,b,c from B
insert into A(a,b,c) select * from(SELECT * FROM(SELECT f1,f2 FROM b JOIN c) AS tb)

发表评论

电子邮件地址不会被公开。 必填项已用*标注