|
Yes, EXISTS will allow SQL to use an index to determine whether the match is found, versus compiling a list of all possible matches and looking up your target row in this list. The IN syntax is great for short lists, but as I recall, it forces SQL into a table scan, where each record must be parsed for eligibility. Eric DeLong Sally Beauty Company MIS-Project Manager (BSG) 940-297-2863 or ext. 1863 -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Ron Adams Sent: Monday, January 16, 2006 4:04 PM To: Midrange Systems Technical Discussion Subject: Re: SQL UPDATE using INNER JOIN? Is there any difference/advantage to using the EXISTS vs the IN clause? This is the way I'm currently trying to do it. However, The whole reason for researching the INNER JOIN was due to this taking a really long time to run. When the IN clause is used it would appear to be re-querying the table for every record. You can imagine the overhead and time involved if there are several hundred thousand records.
As an Amazon Associate we earn from qualifying purchases.
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.