Advantage SQL Engine
The Advantage SQL Engine supports the following operators. They are listed in order of precedence from highest precedence to lowest. Note that the operator precedence can be modified with the use of parentheses.
Description |
Operators |
Sign (unary plus/minus) |
+, - |
Multiplication |
*, / |
Addition |
+, - |
Comparison |
>, >=, <, <=, =, <>, [NOT] LIKE, [NOT] IN, [NOT] BETWEEN, IS [NOT] NULL |
Logical NOT |
NOT |
Logical AND |
AND |
Logical OR |
OR |
The following rules describe which operand types can be used with which operators:
Numeric values are valid operands for Sign, Multiplication, and Addition.
Numeric, date, time and timestamp values are valid operands for Comparison operators except for [NOT] LIKE.
String values are valid operands for the + Addition operator (concatenation) and all Comparison operators.
Logical values are valid operands for Comparison operators = (equals), <> (not equals) and IS [NOT] NULL.
Date values are valid operands for Addition operators when one side is a numeric value. For example, date + numeric, date - numeric, and numeric + date are all valid.
Valid operands for the logical operators NOT, AND, and OR are any valid comparison expression.
Fixed length Binary values (RAW fields) are valid operands for all Compare operators except the [NOT] LIKE and [NOT] BETWEEN operators.
Variable length binary values (BLOB fields) are valid operands for the IS [NOT] NULL operator.