---
title: "LEFT"
description: "The LEFT SQL function extracts a substring from a text using characters from the left side."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/left
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/left
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> | | LEFT[LEFT]:::quoted
    LEFT --> End((END))
```

## Purpose
The `LEFT` SQL function extracts a substring from a text using characters from the left side. The original input text is provided when the text has less characters than the desired length.

Parameters:
- Input (`varchar2`): text to extract substring from.
- Length (`int32`): maximum length of the substring.

Returns: substring from the left side of the input as a `varchar2`.

## Examples
The following example retrieves the left three characters of a text:
```sql
select left('abcdefg', 3)

----------------
abc
```
The following example retrieves the left nine characters of a text:
```sql
select left('abcdefg', 9)

----------------
abcdefg
```