Използване на подзаявки
Най-широко поддържаната опция
UPDATE INVOICES
SET s_id = (SELECT cs.s_id
FROM CUSTOMERS_AND_SALES cs
WHERE cs.c_id = INVOICES.c_id),
s_name = (SELECT cs.s_name
FROM CUSTOMERS_AND_SALES cs
WHERE cs.c_id = INVOICES.c_id)
WHERE INVOICES.c_id IN (SELECT cs.s_id
FROM CUSTOMERS_AND_SALES cs)
Използване на JOINs
UPDATE INVOICES
JOIN CUSTOMERS_AND_SALES cs ON cs.c_id = INVOICES.c_id
SET s_id = cs.s_id,
s_name = cs.s_name