update comment set comment.pid=team.pid where comment.tid=team.id; 
comment 和 team 是同一个数据库中的表...,这条语句的目的是根据comment中的字段tid,对应team表中字段id,, 填充comment表中的pid

解决方案 »

  1.   

    update comment inner join team 
    on comment.tid=team.id
    set comment.pid=team.pid 
      

  2.   

    update comment,team  
    where  comment.tid=team.id
    set comment.pid=team.pid ;
      

  3.   

    update comment,team set comment.pid=team.pid where comment.tid=team.id;
      

  4.   

    或者update comment using comment,team ...
      

  5.   

    update comment,team   
    where comment.tid=team.id
    set comment.pid=team.pid ;