An expression in a WHERE clause names or specifies something you want to compare to something else.
The expressions you specify can be:
… WHERE EMPNO = '000200'
EMPNO names a column that is defined as a 6-byte character value.
For example:
… WHERE INTEGER(PRENDATE - PRSTDATE) > 100
When the order of evaluation is not specified by parentheses, the expression is evaluated in the following order:
Operators on the same precedence level are applied from left to right.
… WHERE 40000 < SALARY
SALARY names a column that is defined as an 9-digit packed decimal value (DECIMAL(9,2)). It is compared to the numeric constant 40000.
… WHERE EMPNO = :EMP
… WHERE LASTNAME = USER
… WHERE DUE_DATE IS NULL
A search condition can specify many predicates separated by AND and OR. No matter how complex the search condition, it supplies a TRUE or FALSE value when evaluated against a row. There is also an unknown truth value, which is effectively false. That is, if the value of a row is null, this null value is not returned as a result of a search because it is not less than, equal to, or greater than the value specified in the search condition.
To fully understand the WHERE clause, you need to know the order SQL evaluates search conditions and predicates, and compares the values of expressions. This topic is discussed in the SQL Reference topic collection.