サブクエリの使用
最も広くサポートされているオプション
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)
JOINの使用
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