Specifications

Using SQL Select
178 InfoMaker
3 Continue to specify additional columns for sorting in ascending or
descending order as needed.
You can change the sorting order by dragging the selected column names
up or down. With the following sorting specification, rows will be sorted
first by department ID, then by employee ID:
4 Define limiting (Where view), grouping (Group view), and limiting
groups (Having view) criteria as appropriate.
5 Click the SQL Select button to return to the Report painter.
Defining GROUP BY
criteria
You can group the retrieved rows by specifying groups that correspond to the
GROUP BY clause in the SELECT statement. This grouping happens before the
data is retrieved into the report. Each group is retrieved as one row into the
report.
For example, if in the
SELECT statement you group data from the Employee
table by department ID, you will get one row back from the database for every
department represented in the Employee table. You can also specify computed
columns, such as total and average salary, for the grouped data. This is the
corresponding
SELECT statement:
SELECT dept_id, sum(salary), avg(salary)
FROM employee
GROUP BY dept_id
If you specify this with the Employee table in the EAS Demo DB, you get five
rows back, one for each department.
For more about
GROUP BY, see your DBMS documentation.