该 SQUARE 函数返回指定数值的平方。
该 SQUARE 函数返回 Azure Cosmos DB for NoSQL 中数值的平方。
Syntax
SQUARE(<numeric_expr>)
Arguments
| Description | |
|---|---|
numeric_expr |
数值表达式。 |
返回类型
返回数值表达式。
例子
本部分包含有关如何使用此查询语言构造的示例。
返回数字的平方
在此示例中,函数 SQUARE 用于返回各种数字的平方。
SELECT VALUE {
squareZero: SQUARE(0),
squareOne: SQUARE(1),
squareTwo: SQUARE(2),
squareThree: SQUARE(3),
squareNull: SQUARE(null)
}
[
{
"squareZero": 0,
"squareOne": 1,
"squareTwo": 4,
"squareThree": 9
}
]
注解
- 此函数不使用索引。