Database Guide


SELECT statement

To specify the example SQL SELECT statement

SELECT EMPLOYEE.JOBCODE, COUNT(*)
   FROM EMPLOYEE
   GROUP BY EMPLOYEE.JOBCODE
   HAVING MIN(EMPLOYEE.AGE) > 40

do the following:

  1. In the Query name field, type a name for the SELECT statement.
  2. In the Description field, type a description for the SELECT statement.
  3. In the Tables/views list, select EMPLOYEE.
  4. In the Columns list, select EMPLOYEE.JOBCODE.
  5. From the Computed columns pop-up menu, select Create.
  6. On the Computed Column Details window, do the following:
    1. From the Unary operator pull-down menu, select COUNT(*).
    2. Select Apply
  7. In the Computed columns list, select COUNT(*).
  8. From the Clause pull-down menu, select GROUP BY.
  9. On the GROUP BY Details window, do the following:
    1. In the Columns list, select EMPLOYEE.JOBCODE.
    2. Select Apply.
  10. From the Clause pull-down menu, select HAVING.
  11. On the HAVING Details window, do the following:
    1. In the Left operand field, select EMPLOYEE.AGE from the list.
    2. From the Unary operator pull-down menu, select Left operand > MAX(x).
    3. In the Operator field, select > from the list.
    4. In the Right operand field, type 40.
    5. Select Apply.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]