title | titleSuffix | description | author | ms.author | ms.reviewer | ms.service | ms.subservice | ms.topic | ms.devlang | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|---|---|---|
RIGHT |
Azure Cosmos DB for NoSQL |
An Azure Cosmos DB for NoSQL system function that returns a substring from the right side of a string. |
jcodella |
jacodel |
sidandrews |
cosmos-db |
nosql |
reference |
nosql |
02/27/2024 |
query-reference |
[!INCLUDENoSQL]
Returns the right part of a string up to the specified number of characters.
RIGHT(<string_expr>, <numeric_expr>)
Description | |
---|---|
string_expr |
A string expression. |
numeric_expr |
A numeric expression specifying the number of characters to extract from string_expr . |
Returns a string expression.
The following example returns the right part of the string Microsoft
for various length values.
:::code language="nosql" source="~/cosmos-db-nosql-query-samples/scripts/right/query.sql" highlight="2-6":::
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/right/result.json":::
- This function benefits from a range index.