Collections:
ELT() - String at Given Index
How to retrieve the string at a given index in a string list using the ELT() function?
✍: FYIcenter.com
ELT(N, str1, str2, ...) is a MySQL built-in function that
returns the string at a given index in a string list.
For example:
SELECT ELT(3, 'Orange', 'Banana', 'Apple'); -- +-------------------------------------+ -- | ELT(3, 'Orange', 'Banana', 'Apple') | -- +-------------------------------------+ -- | Apple | -- +-------------------------------------+
Reference information of the ELT() function:
ELT(N, str1, str2, ...): str Returns the Nth element of the list of strings: str1 if N = 1, str2 if N = 2, and so on. Returns NULL if N is less than 1, greater than the number of arguments, or NULL. Arguments, return value and availability: N: Required. The index in the string list. str1, str2, ...: One or more strings to form the string list. str: Return value. The string at the given index in the string list. Available since MySQL 4.0.
Related MySQL functions:
⇒ FIELD() - Find String in String List
⇐ CONV() - Binary/HEX String and Integer Conversion
2023-11-12, 1163🔥, 0💬
Popular Posts:
How To Round a Numeric Value To a Specific Precision in SQL Server Transact-SQL? Sometimes you need ...
What are DDL (Data Definition Language) statements for tables in SQL Server? DDL (Data Definition La...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
How to download Microsoft SQL Server 2005 Express Edition in SQL Server? Microsoft SQL Server 2005 E...
How To Format DATETIME Values to Strings with the CONVERT() Function in SQL Server Transact-SQL? SQL...