Syntaxe:
UPDATE a
SET a.Status = b.Status, a.s = b.s
FROM TableA a
INNER JOIN Tableb b
ON a.A = b.A;
SET a.Status = b.Status, a.s = b.s
FROM TableA a
INNER JOIN Tableb b
ON a.A = b.A;
Exemple 1:
update wl
set wl.ID_VisitInstance = vi.ID_Visitinstance
from wllist wl
right join tblDMVisitInstance vi on
vi.ID_Patient = wl.ID_Patient
and vi.ID_VisitModel = wl.ID_VisitModel
and vi.VisitSeq = wl.VisitSeq
set wl.ID_VisitInstance = vi.ID_Visitinstance
from wllist wl
right join tblDMVisitInstance vi on
vi.ID_Patient = wl.ID_Patient
and vi.ID_VisitModel = wl.ID_VisitModel
and vi.VisitSeq = wl.VisitSeq
Exemple 2:
update wl
set wl.ID_FormInstance = fi.ID_FormInstance
from wllist wl
right join tblDMFormInstance fi on
fi.ID_FormModel = wl.ID_FormModel
and fi.ID_VisitInstance = wl.ID_VisitInstance
and fi.ID_Patient = wl.ID_Patient
Aucun commentaire:
Enregistrer un commentaire