# `LEFT`

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

Returns the first *n* characters from a string.

## Syntax

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

## Arguments

### Required

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

## Returns

Returns a text value that contains the leftmost characters.

## Considerations

- When *n* is negative, returns all but the last |*n*| characters.
- If *n* exceeds string length, returns the entire string.

## Examples

### Get First Characters

Extract the first two characters.

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

Returns `'ab'`.

## Related Documentation

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