mitted only in the <code class="literal">SELECT</code> list
    and the <code class="literal">ORDER BY</code> clause of the query. They are forbidden
    elsewhere, such as in <code class="literal">GROUP BY</code>, <code class="literal">HAVING</code>
    and <code class="literal">WHERE</code> clauses.  This is because they logically
    execute after the processing of those clauses.  Also, window functions
    execute after non-window aggregate functions.  This means it is valid to
    include an aggregate 