
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is MySQL ELT() function?
MySQL ELT() function returns the string which is at index number specified in the argument list. The first argument would be the index of the string to be retrieved from the argument list.
Syntax
ELT(index number, str1, str2,…,strN)
Here index number is an integer and it is the index of the string to be retrieved. And str1, str2 ,…, strN are the strings among which the search would happen.
Example
mysql> Select ELT(4,'Ram','is','a','good','boy')As Result; +--------+ | Result | +--------+ | good | +--------+ 1 row in set (0.00 sec)
From the above example, we can see that ELT() returns ‘good’ as output because it is at index 4 in the list of strings and we provided 4 as the first argument.
- Related Articles
- What is ELT?
- What MySQL ELT() function returns if we the index number, provided as an argument, is less than 1?
- What MySQL ELT() function returns if the index number, provided as an argument, is higher than the number of strings?
- What would be the output of MySQL ELT() function if the index number, provided as an argument, is not an integer?
- What is the difference between ETL and ELT?
- What is MySQL MAKE_SET() function?
- What is MySQL OCTET_LENGTH() function?
- What is MySQL INTERVAL() function?
- How MySQL FIELD() and ELT() functions are complements of each other?
- What is the use of MySQL FROM_UNIXTIME() function?
- What is the use of MySQL GET_FORMAT() function?
- What is the use of MySQL LAST_INSERT_ID() function?
- What is the use of MySQL CONCAT_WS() function?
- What is the use of MySQL TRUNCATE() function?
- What is the use of MySQL SUBSTRING_INDEX() function?

Advertisements