Program/MSSQL

mssql update 조건

키클쥔장 2012. 10. 8. 14:41

UPDATE 테이블A

   SET 테이블A.변수1 = 테이블B.변수2

  FROM 테이블A,테이블B

 WHERE 테이블A.조건1  = 테이블B.조건2


ext)

update test1
  set test1.id = test2.id
from test1,test2
where test1.name = test2.name