原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/sql-operators-math.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/sql-operators-math.html
本地英文版地址: ../en/sql-operators-math.html
重要: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 当前版本文档。
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;