update infostaff set staffid =
   (select userid from userlist  where staffname = username)

解决方案 »

  1.   

    update tab1 a set id1=
    (select id2 from tab2 b where a.nam1=b.name2);
    前提是没有重名的,有重名的更新就不准了可以+个ronum=1
      

  2.   

    merge into infostaff t1 using on userlist t2 on(t1.username=t2.staffname)
    when matched then
    update set t1.staffid=t2.userid
      

  3.   

    merge into infostaff t1 using on userlist t2 on(t1.username=t2.staffname)
    when matched then
    update set t1.staffid=t2.useridplsql中调试,光标在on的位置提示无效的表名
      

  4.   

    merge into infostaff t1 using on userlist t2 on(t1.username=t2.staffname)
    when matched then
    update set t1.staffid=t2.useridplsql中调试,光标在on的位置提示无效的表名merge into infostaff t1 using userlist t2 on(t1.username=t2.staffname)when matched thenupdate set t1.staffid=t2.userid
      

  5.   

    merge into infostaff t1 using userlist t2 on(t1.username=t2.staffname)
    when matched then
    update set t1.staffid=t2.useridplsql中调试,光标在on的位置提示无效的表名merge into infostaff t1 using userlist t2 on(t1.username=t2.staffname)
    when matched then
    update set t1.staffid=t2.userid