Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 747 Bytes

File metadata and controls

22 lines (16 loc) · 747 Bytes
description
Splits a given string at a specified character and returns the requested part.

SPLIT_PART

Syntax

SPLIT_PART(expression varchar, delimiter varchar, part_number int32) → varchar

  • expression: Input expression.
  • delimiter: String representing the delimiter to split the input expression by.
  • part_number: Requested part of the split. Must be an integer greater than zero.

Examples

{% code title="SPLIT_PART example" %}

SELECT SPLIT_PART('127.0.0.1', '.', 1)
-- 127

{% endcode %}