This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Math Operators
editMath Operators
editPerform mathematical operations affecting one or two values. The result is a value of numeric type.
Add (+)
editSELECT 1 + 1 AS x;
Subtract (infix -)
editSELECT 1 - 1 AS x;
Negate (unary -)
editSELECT - 1 AS x;
Multiply (*)
editSELECT 2 * 3 AS x;
Divide (/)
editSELECT 6 / 3 AS x;
Modulo or Remainder(%)
editSELECT 5 % 2 AS x;