update tab1 
set aa= '5',
    bb = n.col
from tab1 m , tab2 n
where m.关键字 = n.关键字 and m.cc = 'kk'

解决方案 »

  1.   

    update tab1 set bb =(SELECT * FROM TABL WHERE  )
    where cc = 'kk' 
    但问号一定要是唯一值
      

  2.   

    update tab1
     set aa= '5',
     bb =tab2.bb 
    from tab1,tab2
    where tab1.cc = 'kk'
    and tab1.某一个关联字段= tab2.某一个关联字段
      

  3.   

    update tab1 set aa= '5',bb =tb2.colname from tb2 where cc = 'kk'  and tab1...=tab2....--两表的关系
      

  4.   

    update a 
    set a.aa= '5',a.bb =b.col
    from tab1 a ,另一表 b
    where a.cc = 'kk' 
    and a.xx=b.yy  --tab1表和另一表的关联
      

  5.   

    update tab1 set aa= '5',bb =(select bb from tablebb where ...) where cc = 'kk' 
      

  6.   

    update a set aa= '5',bb =tb2.colname from tab1 a ,tab2 b where a.cc = 'kk'  and tab1.关联字段=tab2.关联字段--两表的关系,可以有多个关联字段