UPPER (Azure Cosmos DB)UPPER (Azure Cosmos DB)

返回在将小写字符数据转换为大写后的字符串表达式。Returns a string expression after converting lowercase character data to uppercase.

UPPER 系统函数不使用索引。The UPPER system function does not utilize the index. 如果计划频繁进行不区分大小写的比较,则 UPPER 系统函数可能会消耗大量 RU。If you plan to do frequent case insensitive comparisons, the UPPER system function may consume a significant amount of RU's. 如果是这种情况,可以在插入时将大小写规范化,而不是每次都使用 UPPER 系统函数将数据规范化以进行比较。If this is the case, instead of using the UPPER system function to normalize data each time for comparisons, you can normalize the casing upon insertion. 于是,诸如 SELECT * FROM c WHERE UPPER(c.name) = 'BOB' 的查询只需变成 SELECT * FROM c WHERE c.name = 'BOB'。Then a query such as SELECT * FROM c WHERE UPPER(c.name) = 'BOB' simply becomes SELECT * FROM c WHERE c.name = 'BOB'.

语法Syntax

UPPER(<str_expr>)  

参数Arguments

str_exprstr_expr
是一个字符串表达式。Is a string expression.

返回类型Return types

返回一个字符串表达式。Returns a string expression.

示例Examples

以下示例演示如何在查询中使用 UPPERThe following example shows how to use UPPER in a query

SELECT UPPER("Abc") AS upper  

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

[{"upper": "ABC"}]  

备注Remarks

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

后续步骤Next steps