Used with variables, constants, and column names in many SQL statements, functions, and expressions. An expression returns values and can be nested.
{constant | column_name | function | (subquery)}
[{operator | AND | OR | NOT}
{constant | column_name | function | (subquery)}...]
where
When more than one logical operator is used in a statement, AND is processed first. You can change the order of execution by using parentheses.
When more than one logical operator is used in a statement, OR is evaluated after AND. You can change the order of execution by using parentheses.
Character-constant expressions are treated as varchar. If they are compared with non-varchar variables or column data, the datatype precedence rules are used in the comparison (that is, the lower datatype is converted to the higher). If implicit conversion of the lower to the higher is not allowed, use CONVERT. For details, see the Functions topic.
Comparing a char expression to a varchar expression follows the datatype precedence rule (the lower datatype is converted to the higher). All varchar expressions are converted to char (that is, trailing blanks are added) for the comparison.
Functions | SELECT |
Operators | Subqueries |
Search Conditions | Wildcard Characters |