Sybase 2 Barcode Reader User Manual


 
CHAPTER 4 Defining DataWindow Objects
DataWindow Designer User’s Guide 135
3 Continue to specify additional columns for grouping within the first
grouping column as needed.
To change the grouping order, drag the column names in the right side to
the positions you want.
4 Define sorting (Sort view), limiting (Where view), and limiting groups
(Having view) criteria as appropriate.
5 Click the Return button to return to the DataWindow painter.
Defining HAVING
criteria
If you have defined groups, you can define HAVING criteria to restrict the
retrieved groups. For example, if you group employees by department, you can
restrict the retrieved groups to departments whose employees have an average
salary of less than $50,000. This corresponds to:
SELECT dept_id, sum(salary), avg(salary)
FROM employee
GROUP BY dept_id
HAVING avg(salary) < 50000
If you specify this with the Employee table in the EAS Demo DB, you will get
three rows back, because there are three departments that have average salaries
less than $50,000.
To define HAVING criteria:
Click the Having tab to make the Having view available (or select
View>Having if the Having view is not currently displayed).
Each row in the Having view is a place for entering an expression that
limits which groups are retrieved. For information on how to define
criteria in the Having view, see the procedure in “Defining WHERE
criteria” on page 131.