ELT()

Overview

Returns the string that corresponds to the given numeric position in a list of strings.

USAGE

ELT(position, expr[, expr] ...)

Argument Name

Description

position

The index or numeric position to return from the list of expressions

expr

One or more comma-separated strings

DETAILS

ELT() is a string function that returns the string that corresponds to the given numeric position in a list of strings.

The first argument is the 1-relative index for the desired string.

A non-string expr argument is converted to a string, if possible.

It is valid to specify a NULL for an expr argument as long as you want that index position to return NULL.

A NULL is returned if the first argument is NULL, less than 1, or greater than the number of expr arguments provided.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT ELT(1, '1a', '2b', '3c', '4d', '5e');
+--------------------------------------+
| ELT(1, '1a', '2b', '3c', '4d', '5e') |
+--------------------------------------+
| 1a                                   |
+--------------------------------------+
SELECT ELT(5, '1a', '2b', '3c', '4d', '5e');
+--------------------------------------+
| ELT(5, '1a', '2b', '3c', '4d', '5e') |
+--------------------------------------+
| 5e                                   |
+--------------------------------------+
SELECT ELT(6, '1a', '2b', '3c', '4d', '5e');
+--------------------------------------+
| ELT(6, '1a', '2b', '3c', '4d', '5e') |
+--------------------------------------+
| NULL                                 |
+--------------------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES