उपश्रेणियों का उपयोग करना
सबसे व्यापक रूप से समर्थित विकल्प
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)
जॉइन का उपयोग करना
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