On Wed, Mar 5, 2025 at 7:43 AM Vern Hamberg via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi Greg

No matter what kind of OUTER JOIN, LEFT RIGHT or DULL, if you say SELECT
* you'll get the doubling up of the same columns.


No, no you won't IF you use USING (MYKEY) instead of ON A.MYKEY = B.MYKEY...
https://www.ibm.com/docs/en/i/7.4?topic=clause-joined-table#rbafzjoinedt__title__3

The result table of the join contains the columns from the USING clause
first, then the columns from the first table of the join that were not in
the USING clause, followed by the remaining columns from the second table
of the join that were not in the USING clause. Any column specified in the
USING clause cannot be qualified in the query.


It's a sometimes useful tidbit to know...

Not always useful on the IBM i given the legacy standards of most shops to
have unique column names.
Also last I checked, it only works when dealing with a single join.

Charles

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