Suppose you have the following SQL SELECT statement:
SELECT EMPLOYEE.JOBCODE, COUNT(*)
FROM EMPLOYEE
GROUP BY EMPLOYEE.JOBCODE
HAVING MAX(EMPLOYEE.AGE) > 40
To specify the statement:
- In the Query name field, type a name for the SELECT
statement.
- In the Description field, type a description for the SELECT
statement.
- In the Tables/views list, select EMPLOYEE.
- In the Columns list, select
EMPLOYEE.JOBCODE.
- From the Computed columns pop-up menu, select
Create.
- In the Computed Column Details window, select COUNT(*) from the
Unary operator menu; then select Apply.
- In the Computed columns list, select
COUNT(*).
- From the Clause menu, select GROUP BY.
- In the GROUP BY Details window, select EMPLOYEE.JOBCODE
in the Columns list, and select Apply.
- From the Clause menu, select HAVING.
Finally, in the HAVING Details window, do the following:
- In the Left operand field, select
EMPLOYEE.AGE.
- From the Unary operator menu, select Left operand
> MAX(x).
- In the Operator field, select >.
- In the Right operand field, type
40
- Select Apply.