Syntax
ELT(N, str1, str2, str3,...)
Purpose
ELT() returns a string corresponding to the specified index.
If N=1, the return value is str1. If N=2, the return value is str2, and so forth. If N is less than 1 or greater than the number of strings, NULL is returned.
The ELT() function is the complement of the FIELD() function.
Examples
obclient> SELECT ELT(3, 'abc1', 'abc2', 'abc', 'abc4', 'abc'), ELT(0, 'null1', NULL);
+----------------------------------------------+-----------------------+
| ELT(3, 'abc1', 'abc2', 'abc', 'abc4', 'abc') | ELT(0, 'NULL1', NULL) |
+----------------------------------------------+-----------------------+
| abc | NULL |
+----------------------------------------------+-----------------------+
1 row in set