SQUARE (Azure Cosmos DB)SQUARE (Azure Cosmos DB)

适用于: SQL API

返回指定数字值的平方。Returns the square of the specified numeric value.

语法Syntax

SQUARE(<numeric_expr>)  

参数Arguments

numeric_exprnumeric_expr
是一个数值表达式。Is a numeric expression.

返回类型Return types

返回一个数值表达式。Returns a numeric expression.

示例Examples

以下示例返回数字 1-3 的平方。The following example returns the squares of numbers 1-3.

SELECT SQUARE(1) AS s1, SQUARE(2.0) AS s2, SQUARE(3) AS s3  

下面是结果集。Here is the result set.

[{s1: 1, s2: 4, s3: 9}]  

备注Remarks

此系统函数不会使用索引。This system function will not utilize the index.

后续步骤Next steps