RAND (Azure Cosmos DB)RAND (Azure Cosmos DB)

返回 [0,1) 中随机生成的数值。Returns a randomly generated numeric value from [0,1).

语法Syntax

RAND ()  

返回类型Return types

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

备注Remarks

RAND 是非确定性的函数。RAND is a nondeterministic function. 重复调用 RAND 不会返回相同的结果。Repetitive calls of RAND do not return the same results.

示例Examples

以下示例返回一个随机生成的数值。The following example returns a randomly generated numeric value.

SELECT RAND() AS rand 

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

[{"rand": 0.87860053195618093}]  

备注Remarks

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

后续步骤Next steps