In a query, a column can be processed based on conditions. The WHERE clause specifies a search condition for data.
WHERE search_condition
search_condition :
• comparison_predicate
• between_predicate
• exists_predicate
• in_predicate
• null_predicate
• like_predicate
• quantified predicate
• set_predicate
The WHERE clause specifies a condition that determines the data to be retrieved by search_condition or a query. Only data for which the condition is true is retrieved for the query results. (NULL value is not retrieved for the query results because it is evaluated as unknown value.)
The logical operator AND or OR can be used for multiple conditions. If AND is specified, all conditions must be true. If OR is specified, only one needs to be true. If the keyword NOT is preceded by a condition, the meaning of the condition is reserved. The following table shows the order in which logical operators are evaluated.
Priority |
Operator |
Function |
---|---|---|
1 |
() |
Logical expressions in parentheses are evaluated first. |
2 |
NOT |
Negates the result of the logical expression. |
3 |
AND |
All conditions in the logical expression must be true. |
4 |
OR |
One of the conditions in the logical expression must be true. |