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

 

posted on 2018-03-19 12:58  zyz913614263  阅读(731)  评论(0编辑  收藏  举报

导航