With INNER JOIN the WHERE for join selection should always be the
same. Thus why the QMQRY output was and remains valid, from its
availability prior to the JOIN syntax.
I think some other responses were over-presumptive on what should be
expected when using WHERE clause to do joins, beyond the INNER JOIN.
Albeit I do not recall any more than the simples case of only the join
selection being specified. However...
For any other JOIN type [than INNER JOIN] it is probably best to be
in the habit of explicitly stating the JOIN ON, because the intent to
the query engine may become ambiguous when there are any more selections
than the between-file tests to effect the join. In such an ambiguous
request, the query engine is not obligated to operate in the way you
have assumed it will. The outcome could include a possibly changing
result set. For example in an OUTER JOIN, some WHERE clause selections
could limit the results prior to the join selection; e.g. because the
optimizer found an index that quickly limits the rows to be joined, and
because no join selection rules were explicitly stated there is no
requirement to order when the selection occurs.
So rather than as a "performance boost", make a habit of avoiding use
of the WHERE clause for join to prevent surprises; be explicit in your
intentions for the SQL request that is sent to the query engine.
Regards, Chuck
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.