POWER (Azure Cosmos DB)POWER (Azure Cosmos DB)
适用于:
SQL API
返回指定表达式的指定幂的值。Returns the value of the specified expression to the specified power.
语法Syntax
POWER (<numeric_expr1>, <numeric_expr2>)
参数Arguments
numeric_expr1numeric_expr1
为数值表达式。Is a numeric expression.
numeric_expr2numeric_expr2
是要将 numeric_expr1 提升到的幂次。Is the power to which to raise numeric_expr1.
返回类型Return types
返回数值表达式。Returns a numeric expression.
示例Examples
下列示例演示一个数字的 3 次幂(数的立方)的运算。The following example demonstrates raising a number to the power of 3 (the cube of the number).
SELECT POWER(2, 3) AS pow1, POWER(2.5, 3) AS pow2
下面是结果集:Here is the result set.
[{pow1: 8, pow2: 15.625}]