ELT
Syntax
ELT(N, str1, str2, str3,...)
Description
Returns the index of the retrieved string.
If N=1, the return value is str1; if N=2, the return value is str2; and so on. If N is less than 1 or greater than the number of parameters, the return value is NULL.
ELT() is the inverse of FIELD().
Examples
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 (0.001 sec)