How Do I...
You can specify a WHERE clause as one of the following:
- An SQL predicate
- A logical expression
- A compound logical expression
A WHERE clause cannot contain a function.
Specifying an SQL predicate
An SQL predicate is a condition that evaluates to true, false,
or unknown.
To specify a WHERE clause that is an SQL predicate:
- Specify the left operand of the SQL predicate.
- Select the keyword operator of the SQL predicate.
- Specify the right operand of the SQL predicate, if any.
- If the right operand is a value, type the value in the field.
- If the right operand is a nested SELECT statement:
- From the Unary operator menu, select Right operand
> Nested SELECT, and then the type of nested
SELECT statement you want to use.
- In the Select a query window, specify the nested
SELECT statement, and select OK.
- If the SQL predicate has additional operands or keywords, type them in the
field.
- To apply a unary operator to the right operand you have specified, from
the Unary operator menu, select Right operand and then
the unary operator you want to apply.
Example:
- (EMPLOYEE.STATUS IS NULL)
- (EMPLOYEE.NAME LIKE 'JOHN%')
- (WAGES.SALARY BETWEEN 2000 AND 3000)
Specifying a logical expression
A logical expression is mathematical condition that evaluates to
true, false, or unknown.
To specify a WHERE clause that is a logical expression:
- Specify the left operand of the logical expression.
- To apply a unary operator to the left operand you have specified, from the
Unary operator menu, select Left operand and then the
unary operator you want to apply.
- Select the logical operator of the logical expression.
- Specify the right operand of the logical expression.
- If the right operand is a value, type the value in the field.
- To apply a unary operator to the right operand you have specified, from
the Unary operator menu, select Right operand and then
the unary operator you want to apply.
Example:
- (EMPLOYEE.NUMBER = WAGES.EMPNUMBER)
- (MIN(EMPLOYEE.AGE) > 40)
Specifying a compound logical expression
A compound logical expression is a logical expression that consists of a
combination of expressions, SQL predicates, or other logical
expressions.
To specify a WHERE clause that is a compound logical expression:
- Specify one of the expressions or logical expressions contained in the
compound logical expression by following the same steps as for specifying a
WHERE clause that is a logical expression.
If you are specifying an expression, select a binary operator instead of a
logical operator when following the steps for specifying a WHERE clause that
is a logical expression.
- Select Add to operand lists.
- Repeat the steps above for each expression or logical expression contained
in the compound logical expression.
- Specify the left operand of the compound logical expression.
- If the left operand is an expression you specified using the first two
steps above, select it from the list.
- To apply a unary operator to the left operand you have specified, from the
Unary operator menu, select Left operand and then the
unary operator you want to apply.
- Select the logical operator of the compound logical expression.
- Specify the right operand of the compound logical expression.
- If the right operand is an expression you specified using the first two
steps above, select it from the list.
- If the right operand is a value, type the value in the field.
- To apply a unary operator to the right operand you have specified, from
the Unary operator menu, select Right operand and then
the unary operator you want to apply.
Example:
((WAGES.SALARY - WAGES.TAXES) > 3000) AND NOT (EMPLOYEE.AGE < 40)
Specifying an empty expression
To specify an empty expression for the WHERE clause:
- If an operator is specified in the Operator field, select
<none> from the list.
- If an operand is specified in the Left operand field, delete
it.
The Expression field should now be empty.
[ Top of Page | Previous Page | Next Page | Table of Contents ]