> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RIGHT

> Returns characters from the end of a string.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

Returns NULL if either argument is NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
right(value, count)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | The string to slice. |
| count | INTEGER | Yes | The number of Unicode characters to retain. |

## Returns

* Type: STRING
* Possible values: A string slice; zero count returns an empty string.
* NULL behavior: Returns NULL if either argument is NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* For a negative count, LEFT removes that many characters from the end; RIGHT removes that many characters from the start.
* Counts use Unicode code points. A count larger than the string length returns the whole string.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT right('abcde', 2) AS positive, right('abcde', -2) AS negative;
```

| positive | negative |
| - | - |
| de | cde |

### Count Unicode characters

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT right('abcé猫', 2) AS last_two;
```

| last\_two |
| - |
| é猫 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.