update record a set a.username = 
       ( select b.name from user b where a.userid = b.id )
where a.username is null;

解决方案 »

  1.   

    update record a set a.username = 
           ( select b.name from user b where a.userid = b.id )
    where a.username is null;
      

  2.   

    update record set username = user.name
       where record.id=user.id and username is null;
      

  3.   

    不会吧,sql语句不会有错,核对你的登陆用户名和表名。
      

  4.   

    update record a set a.username = 
           ( select b.name from user b where a.userid = b.id )
    where a.username is null;
    这个语句应该是对的update record set username = user.name
       where record.id=user.id and username is null;
    这个语句执行或许会成功,但结果是错的