Logical Functions
List of logical functions
EQ
GT
GTE
LT
LTE
NE
BTW
NOT_BTW
BTW_LEFT_OPEN
BTW_RIGHT_OPEN
AND
OR
IS_NULL
IS_NOT_NULL
IF
NOT
The return value of logical functions is always boolean, i.e., true or false, with the exception of IF.
Deprecated functions
REGEXP
Equal (EQ)
Returns true if two values are equal to each other, or false otherwise.
Takes 2 arguments.
Greater than (GT)
Returns true if the first value is greater than the second value, or false otherwise.
Takes 2 arguments.
Both arguments have to be numbers, variables or strings.
When used with strings, it returns true or false based on their alphabetical order.
Greater than or equal (GTE)
Returns true if the first value is greater than or equal to the second value, or false otherwise.
Takes 2 arguments.
Both arguments have to be numbers, variables or strings.
When used with strings, it returns true or false based on their alphabetical order.
Less than (LT)
Returns true if the first value is lower than the second value.
Takes 2 arguments.
Both arguments have to be numbers, variables or strings.
When used with strings, it returns true or false based on their alphabetical order.
Less than or equal (LTE)
Returns true if the first value is less than or equal to the second value.
Takes 2 arguments.
Both arguments have to be numbers, variables or strings.
When used with strings, it returns true or false based on their alphabetical order.
Not equal (NE)
Returns true if the first value is not equal to the second value.
Takes 2 arguments.
Between (BTW)
Returns true if the second value is between the first and the third value, meaning in particular that first argument ≤ second argument ≤ third argument.
Takes 3 arguments.
Between left open (BETWEEN_LEFT_OPEN)
Returns true if the second value is between the first (excluding) and the third (including) value, meaning in particular that first argument < second argument ≤ third argument.
Takes 3 arguments.
Between right open (BETWEEN_RIGHT_OPEN)
Returns true if the second value is between the first (including) and the third (excluding) value, meaning in particular that first argument ≤ second argument < third argument.
Takes 3 arguments.
And (AND)
Returns true if all of its arguments evaluate to true.
Must have at least 1 argument.
Arguments have to be booleans, numbers or variables.
If the argument is a number, 0 is evaluated as false and anything else as true.
Alternatively, OR can take an array of values in any argument.
Or (OR)
Returns true if at least one of its arguments evaluates to true.
Must have at least 1 argument.
Arguments have to be booleans, numbers or variables.
If the argument is a number, 0 is evaluated as false and anything else as true.
Alternatively, OR can take an array of values in any argument.
Is null (IS_NULL)
Returns true if the value is null (empty).
Must have 1 argument.
Is not null (IS_NOT_NULL)
Returns true if the value is not null (empty).
Must have 1 argument.
Negation (NOT)
Returns the opposite of a boolean value.
Must have 1 argument.
Condition (IF)
Returns the second argument if the first argument is true, otherwise returns the third argument.
Must have 3 arguments.
The first argument is a condition. The condition must be of the boolean type (true/false).
The second argument is an arbitrary value.
The third argument is an arbitrary value.
Regular expression (REGEXP) (deprecated)
This function is deprecated. Use TEST instead (see Text Functions).
Returns true if the first argument matches against a regular expression in the second argument.
Must have 2 arguments.
Arguments have to be numbers, strings or variables.
Last updated