Re: [GENERAL] Fields re-ordered on JOIN with * and USING

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Fields re-ordered on JOIN with * and USING
Дата
Msg-id 6014.1504314878@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Fields re-ordered on JOIN with * and USING  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: [GENERAL] Fields re-ordered on JOIN with * and USING  (Ken Tanzer <ken.tanzer@gmail.com>)
Список pgsql-general
... btw, a little digging shows that this ordering is required by the
SQL standard.  The least excruciating version of the relevant text is
in SQL92 7.5 <joined table>:

            d) Let SLCC be a <select list> of <derived column>s of the form

                 COALESCE ( TA.C, TB.C ) AS C

              for every column C that is a corresponding join column, taken
              in order of their ordinal positions in T1.

            e) Let SL1 be a <select list> of those <column name>s of T1
              that are not corresponding join columns, taken in order of
              their ordinal positions in T1, and let SLT2 be a <select
              list> of those <column name>s of T2 that are not correspond-
              ing join columns, taken in order of their ordinal positions
              in T2.

            f) The descriptors of the columns of the result of the <joined
              table> are the same as the descriptors of the columns of the
              result of

                 SELECT SLCC, SLT1, SLT2 FROM TR1, TR2


Later versions of the standard use many more words to say the same thing.

            regards, tom lane


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Fields re-ordered on JOIN with * and USING
Следующее
От: Ken Tanzer
Дата:
Сообщение: Re: [GENERAL] Fields re-ordered on JOIN with * and USING