doc: mention GROUP BY columns can reference target col numbers

Reported-by: hape <postgres-hape@gmx.de>

Discussion: https://postgr.es/m/168871536004.379168.9352636188330923805@wrigleys.postgresql.org

Backpatch-through: 11
This commit is contained in:
Bruce Momjian 2023-09-26 17:31:06 -04:00
parent 639e1aa81f
commit 1b5a00450a
1 changed files with 3 additions and 0 deletions

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