E.4. OperatorsOperators are used to compose identifiers and literals into larger expressions. Operators can be logical operators , arithmetic operators, or comparison operators. E.4.1. Logical OperatorsThe logical operators are NOT, AND, and OR. These are in precedence order. These have the usual Boolean logic semantics. If a logical operator is applied to header fields or properties whose value is NULL, then the following rules apply:
E.4.2. Arithmetic OperatorsThe arithmetic operators, in precedence order, are + and - (unary); * and /; and + and - (binary). These have the usual arithmetic semantics. Any arithmetic operator that is applied to one or more NULL values evaluates to a NULL value. E.4.3. Comparison OperatorsThe comparison operators can be loosely grouped into equality comparisons and range comparisons. The basic equality comparison operators, in precedence order, are =, >, >=, <, <=, and <>. These binary operators have to be applied to two values of the same type, else the expression will always evaluate to FALSE. If either value is NULL, then the result of the comparison is NULL. There are also the equality operators IS NULL and IS NOT NULL to compare a value to NULL. An equality operator can also be used to check for the presence of a header or property. For example: timezone IS NOT NULL AND country = 'United Kingdom' There are also set and range comparison operators. The BETWEEN operator can be used to check the range of numeric values. For example: userid BETWEEN 00000000 AND 09999999 currRate NOT BETWEEN 0.0 AND 0.9999 The IN operator can be used to perform membership operations on string values: JMSType IN ('msgAck', 'queryAck', 'updateAck') JMSType NOT IN ('msgBroadcast', 'synchMessage') There is also a string comparison operator, LIKE, that allows for wildcard matching on string values. A pattern is used for the right side of the LIKE operator. The pattern consists of a valid string literal where the underscore character, _, matches against any single character, while the % character matches any sequence of zero or more characters. For example: JMSType like '%Ack' label not like 'Step _' The _ and % characters can be used in these string comparison operators if they are escaped by \. For example: slogan LIKE '99 44/100\% pure' |