原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/sql-operators-math.html, 原文档版权归 www.elastic.co 所有

Math Operatorsedit

Perform mathematical operations affecting one or two values. The result is a value of numeric type.

Add (+)edit

SELECT 1 + 1 AS x;

Subtract (infix -)edit

SELECT 1 - 1 AS x;

Negate (unary -)edit

SELECT - 1 AS x;

Multiply (*)edit

SELECT 2 * 3 AS x;

Divide (/)edit

SELECT 6 / 3 AS x;

Modulo or Remainder(%)edit

SELECT 5 % 2 AS x;