---
title: "SPLIT_PART"
description: "The SPLIT_PART SQL function splits a text on a delimiter and returns the requested part, similar to the split_part function of PostgreSQL and Amazon\u2026"
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/split-part
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/split-part
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)) --> SPLIT_PART[SPLIT_PART]:::quoted
    SPLIT_PART --> End((END))
```

## Purpose
The `SPLIT_PART` SQL function splits a text on a delimiter and returns the requested part, similar to the `split_part` function of PostgreSQL and Amazon Redshift.

See also [[TO_ARRAY]].

Parameters:
- Text (`varchar2`): the text to split.
- Delimiter (`varchar2`): the delimiter to split the text on.
- Part number (`int32`): the part to return, with 1 being the first part.

Returns: the requested part as `varchar2`. Returns `null` when the text or delimiter is `null` or empty, when the part number is less than 1 or when the part number exceeds the number of parts.

## Examples
The following example retrieves the second part of `a,b,c`:
```sql
select split_part('a,b,c', ',', 2)

-------------------
b
```
The following example retrieves the fifth part of `a,b,c`; the output is empty since there are only three parts:
```sql
select split_part('a,b,c', ',', 5)

-------------------

```