Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Usage » Querying and Modifying Data » Summarizing, grouping, and sorting query results » The GROUP BY clause: Organizing query results into groups


GROUP BY and the SQL/2003 standard

The SQL/2003 standard for GROUP BY requires the following:

  • A column used in an expression of the SELECT clause must be in the GROUP BY clause. Otherwise, the expression using that column is an aggregate function.

  • A GROUP BY expression can only contain column names from the select list, but not those used only as arguments for vector aggregates.

A standard GROUP BY with vector aggregate functions produces one row with one value per group.

SQL Anywhere support an extension that allows aggregate functions in the HAVING clause, even if they do not exist in the select list or GROUP BY clause.

For more information about SQL Anywhere compliance with other standards, see SQL dialects.