update a set col1=b.col1,col2=b.col2,col3=b.col3
from table1,(select col1,col2,col3 from table2 where id = 1)b

解决方案 »

  1.   

    update table1 set col1=(select col1 from table2 where id = 1)
    ,col2=(select col1 from table2 where id = 1)
    ,col3=(select col1 from table2 where id = 1)
      

  2.   

    UPDATE table1 SET COL1=B.COL1,COL2=B.COL2,COL3=COL3 FROM TABLE1 A,TABLE 2 B WHERE A.ID=B.ID AND B.ID=1
      

  3.   

    你那个格式是insert的格式,呵呵
    update a set a.col1=b.col1,a.col2=b.col2,a.col3=b.col3
    from table1 a,table2 b where a.id=b.id and a.id=1
      

  4.   

    update a set col1=b.col1,col2=b.col2,col3=b.col3
    from table1,(select col1,col2,col3 from table2 where id = 1)b
    where a.id=1  --如果只是更新 table1中与table2 id相同的