# `RIGHT`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the last *n* characters from a string.

## Syntax

```sql
right(<string>, <n>)
```

## Arguments

### Required

- `<string>`: The source string.
- `<n>`: The number of characters to return. When negative, returns all but the first |*n*| characters.

## Returns

Returns a text value that contains the rightmost characters.

## Considerations

- If <n> exceeds the length of the string, returns the entire string.

## Examples

### Get Last Characters

Extract the last two characters.

```sql
SELECT right('abcde', 2) AS result;
```

Returns `'de'`.

## Related Documentation

- [String Types](/docs/data/data-cloud-query-guide/references/dc-sql-reference/string.md)
