...
Example | Operators | Description |
---|---|---|
A[B] , A.identifier | bracket_op([]), dot(.) | element selector, dot |
-A | unary(+), unary(-), unary(~) | unary prefix operators |
A IS (NOT) NULL[NOT] (NULL|TRUE|FALSE) | IS NULL,IS NOT NULL, ... | unary suffix |
A ^ B | bitwise xor(^) | bitwise xor |
A * B | star(*), divide(/), mod(%), div(DIV) | multiplicative operators |
A + B | plus(+), minus(-) | additive operators |
A || B | string concatenate(||) | string concatenate |
A & B | bitwise and(&) | bitwise and |
A | B | bitwise or(|) | bitwise or |
...
Operator | Operand types | Description |
---|---|---|
A = B | All primitive types | TRUE if expression A is equal to expression B otherwise FALSE. |
A == B | All primitive types | Synonym for the = operator. |
A <=> B | All primitive types | Returns same result with EQUAL(=) operator for non-null operands, but returns TRUE if both are NULL, FALSE if one of the them is NULL. (As of version 0.9.0.) |
A <> B | All primitive types | NULL if A or B is NULL, TRUE if expression A is NOT equal to expression B, otherwise FALSE. |
A != B | All primitive types | Synonym for the <> operator. |
A < B | All primitive types | NULL if A or B is NULL, TRUE if expression A is less than expression B, otherwise FALSE. |
A <= B | All primitive types | NULL if A or B is NULL, TRUE if expression A is less than or equal to expression B, otherwise FALSE. |
A > B | All primitive types | NULL if A or B is NULL, TRUE if expression A is greater than expression B, otherwise FALSE. |
A >= B | All primitive types | NULL if A or B is NULL, TRUE if expression A is greater than or equal to expression B, otherwise FALSE. |
A [NOT] BETWEEN B AND C | All primitive types | NULL if A, B or C is NULL, TRUE if A is greater than or equal to B AND A less than or equal to C, otherwise FALSE. This can be inverted by using the NOT keyword. (As of version 0.9.0.) |
A IS NULL | All types | TRUE if expression A evaluates to NULL, otherwise FALSE. |
A IS NOT NULL | All types | FALSE if expression A evaluates to NULL, otherwise TRUE. |
A IS [NOT] (TRUE|FALSE) | Boolean types | Evaluates to TRUE only if A mets the condition. (since:3.0.0 ) |
A [NOT] LIKE B | strings | NULL if A or B is NULL, TRUE if string A matches the SQL simple regular expression B, otherwise FALSE. The comparison is done character by character. The _ character in B matches any character in A (similar to . in posix regular expressions) while the % character in B matches an arbitrary number of characters in A (similar to .* in posix regular expressions). For example, 'foobar' like 'foo' evaluates to FALSE whereas 'foobar' like 'foo_ _ _' evaluates to TRUE and so does 'foobar' like 'foo%'. |
A RLIKE B | strings | NULL if A or B is NULL, TRUE if any (possibly empty) substring of A matches the Java regular expression B, otherwise FALSE. For example, 'foobar' RLIKE 'foo' evaluates to TRUE and so does 'foobar' RLIKE '^f.*r$'. |
A REGEXP B | strings | Same as RLIKE. |
...