mysql sql语句高级写法

将user表的内容,插入到team_member表
INSERT
INTO team_member (Nike,HeadImageUrl) SELECT Nike,HeadImageUrl FROM user WHERE EXISTS (SELECT * FROM team_member WHERE team_member.Id=user.Id);
将user表的内容更新到team_member表
update
team_member,user set team_member.nike=`user`.nike,team_member.HeadImageUrl=`user`.HeadImageUrl where team_member.userid=`user`.id

 

    原文作者:SQL
    原文地址: https://www.cnblogs.com/zendu/p/8601351.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞