SQL Anywhere Studio Help
Query Editor Help
Use this tab if you want to group rows in the result set.
Available columns This box lists all the tables you have chosen for your query, and the columns in each table.
Group by columns To group by a column, select a column or set of columns in the Available Columns box and click the right arrow. To delete a column, select it in the Group By Columns box and click the left arrow. Use the up and down arrows to scroll through the columns in the Group By Columns box.
Expression editor Click the Calculator icon, located between the right and left arrows, to open the Expression Editor and build your Group By condition.
Results Click Results at the bottom of the dialog to see the results of your query, or an error message if the query contains errors.
SQL Click on SQL at the bottom of the dialog to see the SQL code for your query.
You can group by columns, alias names, or functions. The result of the query contains one row for each distinct set of values in the named columns, aliases, or functions. All null-containing rows are treated as a single set. The resulting rows are often referred to as groups since there is one row in the result for each group of rows from the table list. Aggregate functions can then be applied to these groups to get meaningful results.
When GROUP BY is used, the Columns tab, Having tab, and Order By tab must not reference any identifier that is not named in the Group By tab. The exception is that the Columns tab and Having tab may contain aggregate functions.
For more information about the Query Editor, see Introducing the Query Editor.
For an introduction to GROUP BY, see Applying aggregate functions to grouped data.
For more information about GROUP BY, see The GROUP BY clause: organizing query results into groups.