vous pouvez joindre les deux tables même sur UPDATE
déclarations,
UPDATE a
SET a.marks = b.marks
FROM tempDataView a
INNER JOIN tempData b
ON a.Name = b.Name
- Démo SQLFiddle
pour des performances plus rapides, définissez un INDEX
sur la colonne marks
sur les deux tables.
en utilisant SUBQUERY
UPDATE tempDataView
SET marks =
(
SELECT marks
FROM tempData b
WHERE tempDataView.Name = b.Name
)
- Démo SQLFiddle