All operators
Operators by type
Mathematical Operators
| Operator | Description | Example | Result | Function |
|---|---|---|---|---|
| + | Addition | 5 + 3 | 8 | ADD |
| - | Subtraction | 7 - 2 | 5 | SUBTRACT |
| * | Multiplication | 4 * 3 | 12 | MULTIPLY |
| / | Division | 7 / 2 | 3.5 | DIVIDE |
| ^ | Power | 2 ^ 3 | 8 | POW |
| // | Integer division | 7 // 3 | 2 | DIVIDE_TYPE |
| % | Modulus (remainder) | 7 % 3 | 1 | MOD |
See also: Math Functions
Logical Operators
| Operator | Description | Example | Result | Function |
|---|---|---|---|---|
| AND | Logical AND | age > 18 AND salary > 50000 | TRUE if both conditions are true | AND |
| OR | Logical OR | status = 'active' OR status = 'pending' | TRUE if either condition is true | OR |
| NOT | Logical NOT | NOT is_deleted | TRUE if is_deleted is false | NOT |
See also: Logical Functions
Comparison Operators
| Operator | Description | Example | Result | Function |
|---|---|---|---|---|
| < | Less than | price < 100 | TRUE if price is less than 100 | LESS_THAN |
| > | Greater than | age > 18 | TRUE if age is greater than 18 | GREATER_THAN |
| <= | Less than or equal to | quantity <= 5 | TRUE if quantity is 5 or less | LESS_THAN_OR_EQUALS |
| >= | Greater than or equal to | score >= 90 | TRUE if score is 90 or greater | GREATER_THAN_OR_EQUALS |
| = | Equal to | status = 'active' | TRUE if status equals 'active' | EQUALS |
| <> or != | Not equal to | color <> 'red' | TRUE if color is not 'red' | NOT_EQUALS |
| BETWEEN | Range check | age BETWEEN 18 AND 65 | TRUE if age is 18-65 inclusive | BETWEEN |
Note: Use a prefix .N to compare floating-point numbers with N digits precision. 0.99999e0 =.4 1.00001e0 → TRUE
See also: Comparison Functions
String Operators
| Operator | Description | Example | Result | Function |
|---|---|---|---|---|
| || | String concatenation | 'Hello' || ' ' || 'World' | 'Hello World' | CONCAT_FN |
| LIKE | Pattern matching | name LIKE 'Jo%' | TRUE if name starts with 'Jo' | LIKE |
See also: String Functions
Set Operators
| Operator | Description | Example | Result | Function |
|---|---|---|---|---|
| IN | Membership check | value IN (1, 2, 3) | TRUE if value is in the list | IN |
See also: Comparison Functions
Special Operators
| Operator | Description | Example | Result | Function |
|---|---|---|---|---|
| IS NULL | NULL check | phone IS NULL | TRUE if phone is NULL | IS_NULL |
| IS NOT NULL | Non-NULL check | email IS NOT NULL | TRUE if email is not NULL | IS_NOT_NULL |
| [] | Array/Row extraction | array[1] or row[field_1] | Returns element at index 1 or field_1 | ARRAY_EXTRACT |
See also: Comparison Functions , Array Functions
Operators' precedence (highest first)
| Precedence | Operators | Description |
|---|---|---|
| 1 | := | Assignment |
| 2 | () | Parentheses |
| 3 | [] | Array/row extraction |
| 4 | :: | Type casting |
| 5 | . | Function chaining |
| 6 | ~ | Bitwise NOT |
| 7 | ^ ** | Power |
| 8 | * / // % | Multiply, divide, integer div, modulo |
| 9 | + - | Addition, subtraction |
| 10 | << >> | Bitwise shift left, bitwise shift right |
| 11 | & | Bitwise AND |
| 12 | | | Bitwise OR |
| 13 | || | String concatenation |
| 14 | = <> != > >= < <=BETWEEN NOT BETWEENLIKE NOT LIKEIN NOT INIS NULL IS NOT NULL | Comparison |
| 15 | NOT | Logical NOT |
| 16 | AND | Logical AND |
| 17 | OR | Logical OR |