Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
doc: mention GROUP BY columns can reference target col numbers
authorBruce Momjian <bruce@momjian.us>
Tue, 26 Sep 2023 21:31:06 +0000 (17:31 -0400)
committerBruce Momjian <bruce@momjian.us>
Tue, 26 Sep 2023 21:31:06 +0000 (17:31 -0400)
Reported-by: hape <postgres-hape@gmx.de>
Discussion: https://postgr.es/m/168871536004.379168.9352636188330923805@wrigleys.postgresql.org

Backpatch-through: 11

doc/src/sgml/ref/select.sgml

index bd727252a1df1a411ddb43892463a10177abbeb5..5df0d89b54b6e087d0eb9f75a76b90e9cc15a524 100644 (file)
@@ -131,6 +131,9 @@ TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ]
       eliminates groups that do not satisfy the given condition.  (See
       <xref linkend="sql-groupby"/> and
       <xref linkend="sql-having"/> below.)
+      Although query output columns are nominally computed in the next
+      step, they can also be referenced (by name or ordinal number)
+      in the <literal>GROUP BY</literal> clause.
      </para>
     </listitem>