|
-----Original Message-----
From: Joe Pluta
update A set (data1, data2) =
(select data1, data2 from B
where A.key1 = B.key1 and A.key2 = B.key2) where exists
(select data1, data2 from B
where joe1.key1 = joe2.key1 and joe2.key2 = joe1.key2)
Note the duplication of the key clause, once to select the
record to update and once to only update those records that
have matches. If you didn't do that, you'd get NULLs in the
data values for records without matches.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.