Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      An aggregate expression represents the application of an aggregate function across the rows selected by a query. An aggregate function reduces multiple inputs to a single output value, such as the sum or average of the inputs. The syntax of an aggregate expression is one of the following:

      aggregate_name (expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
      aggregate_name (ALL expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
      aggregate_name (DISTINCT expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
      aggregate_name ( * ) [ FILTER ( WHERE filter_clause ) ]
      aggregate_name ( [ expression [ , ... ] ] ) WITHIN GROUP ( order_by_clause ) [ FILTER ( WHERE filter_clause ) ]

      https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-AGGREGATES

       

      I find this feature is also an ANSI SQL standard. 

      <aggregate function> ::=
      COUNT <left paren> <asterisk> <right paren> [ <filter clause> ]
      | <general set function> [ <filter clause> ]
      | <binary set function> [ <filter clause> ]
      | <ordered set function> [ <filter clause> ]
      | <array aggregate function> [ <filter clause> ]
      | <row pattern count function> [ <filter clause> ]

      Attachments

        Issue Links

          Activity

            People

              beliefer Jiaan Geng
              yumwang Yuming Wang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: