× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



-----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.

Is the WHERE EXISTS import for every update from one table to another or only when changing or joining on multiple fields? This is exactly the kind of query I was trying to locate last week, but I am only changing one field and joining on one field.

UPDATE File1
SET File1.Data1 = File2.Data1
FROM File1, File2
WHERE File1.Key1 = File2.Key1

Should this work correctly? Thanks.
--
Sean Porterfield

This email is confidential, intended only for the named recipient(s) above and may contain information that is privileged. If you have received this message in error or are not the named recipient(s), please notify the sender immediately and delete this email message from your computer as any and all unauthorized distribution or use of this message is strictly prohibited. Thank you.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.