"David G. Johnston" <david.g.johns...@gmail.com> writes: > On Fri, Sep 1, 2017 at 2:25 PM, Ken Tanzer <ken.tan...@gmail.com> wrote: >> Hi. I recently noticed that when doing a SELECT * with USING, that the >> join field(s) appear first in the output. I'd never noticed that before, >> and was just curious if that is expected behavior or not. Thanks.
> I don't recall if or where it is documented but it is intentional., as is > the documented fact that only one instance of the named column appears in > the output. Yes, it's documented, here: https://www.postgresql.org/docs/current/static/queries-table-expressions.html#QUERIES-FROM under "7.2.1.1. Joined Tables": Furthermore, the output of JOIN USING suppresses redundant columns: there is no need to print both of the matched columns, since they must have equal values. While JOIN ON produces all columns from T1 followed by all columns from T2, JOIN USING produces one output column for each of the listed column pairs (in the listed order), followed by any remaining columns from T1, followed by any remaining columns from T2. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general