CHAPTER 4 Defining DataWindow Objects
DataWindow Designer User’s Guide 119
Example 4
The expressions 100 in the Criteria row and >300 in the Or row for the DeptId
column, together with the expression
<50000 in the Criteria row in the Salary
column, retrieve information for employees who belong to:
• Department 100 and have a salary less than $50,000
or
• A department whose ID is greater than 300, no matter what their salaries
The
SELECT statement that DataWindow Designer creates is:
SELECT emp_id, dept_id, salary
FROM employee
WHERE (dept_id = 100 AND salary < 50000)
OR dept_id > 300
Example 5
The expression IN(100, 200, 500) in the Criteria row in the DeptId column
in the grid retrieves information for employees who are in department 100 or
200 or 500.
The
SELECT statement that DataWindow Designer creates is:
SELECT emp_id, dept_id, salary
FROM employee
WHERE dept_id IN (100, 200, 500)
Example 6
This example shows the use of the word AND in the Or criteria row. In the
Criteria row,
>=500 is in the EmpId column and >=30000 is in the Salary
column. In the Or row,
AND <=1000 is in the EmpId column and AND <=50000
is in the Salary column. These criteria retrieve information for employees who
have an employee ID from 500 to 1000 and a salary from $30,000 to $50,000.