0
更新我有2個表幫助的查詢 - 從2個表
table1: num,X,Y
table2: num,X,Y
我需要在表1更新X和Y其中table1.num = table2.num
怎麼辦呢?
我需要在Oracle查詢(我認爲在SQL Server中,將工作太)
感謝的提前
更新我有2個表幫助的查詢 - 從2個表
table1: num,X,Y
table2: num,X,Y
我需要在表1更新X和Y其中table1.num = table2.num
怎麼辦呢?
我需要在Oracle查詢(我認爲在SQL Server中,將工作太)
感謝的提前
對於Oracle:
UPDATE table1 t1
SET (x,Y) = (SELECT x, y from table2
WHERE t1.num = t2.num)
爲MSSQL:
UPDATE t1
SET x = t2.x,
y = t2.y
FROM table1 t1, table2 t2
WHERE t1.num = t2.num
謝謝!!!!有用 !!!!! – Gold 2010-09-15 09:03:58