puoi unirti a entrambi i tavoli anche su UPDATE dichiarazioni,
UPDATE a
SET a.marks = b.marks
FROM tempDataView a
INNER JOIN tempData b
ON a.Name = b.Name
- Dimostrazione SQLFiddle
per prestazioni più veloci, definisci un INDEX sulla colonna marks su entrambi i tavoli.
utilizzando SUBQUERY
UPDATE tempDataView
SET marks =
(
SELECT marks
FROM tempData b
WHERE tempDataView.Name = b.Name
)
- Dimostrazione SQLFiddle