ESQL numeric operators

ESQL provides the following numeric operators:

Unary Operator -
The result is the negation of the operand (that is, it has the same magnitude as the operand but the opposite sign). You can negate numeric values (INTEGER, DECIMAL and FLOAT) and intervals (INTERVAL).
Operator +
The result is the sum of the two operands. You can add numeric values to intervals, and also to an interval to a datetime value (DATE, TIME, TIMESTAMP, GMTTIME, and GMTTIMESTAMP).
Operator -
The result is the difference between the two operands. It is possible to:
  • Subtract one numeric value from another.
  • Subtract one datetime from another. The result is an interval.
  • Subtract one interval from another.
  • Subtract an interval from a datetime value.
Operator *
The result is the product of the two operands. You can multiply numeric values and multiply an interval by a numeric value.
Operator /
The result is the dividend of the two operands. You can divide numeric values and divide an interval by a numeric value.
Operator ||
The result is the concatenation of the two operands. You can concatenate string values (CHARACTER, BIT, and BLOB).

In all cases, if either operand is NULL, the result is NULL. If the operands are of different types, special rules apply. These are described in Implicit casts.

For examples of how you can use these operators to manipulate datetime values, see Using numeric operators with datetime values.

Related concepts
Message flows
ESQL operators
Mappings
Related tasks
Developing message flow applications
Using numeric operators with datetime values
Developing ESQL
Related reference
Built-in nodes
ESQL
ESQL comparison operators
ESQL logical operators
Rules for ESQL operator precedence