SELECT ELT(4, 'A', 'B', 'C', 'D'); : ELT « String Functions « MySQL Tutorial






mysql>
mysql>
mysql> SELECT ELT(4, 'A', 'B', 'C', 'D');
+----------------------------+
| ELT(4, 'A', 'B', 'C', 'D') |
+----------------------------+
| D                          |
+----------------------------+
1 row in set (0.00 sec)

mysql>








23.10.ELT
23.10.1.ELT(N,str1,str2,str3,...): Returns str1 if N = 1, str2 if N = 2, and so on
23.10.2.SELECT ELT(4, 'A', 'B', 'C', 'D');
23.10.3.SELECT ELT(-1, 'A', 'B', 'C', 'D');
23.10.4.SELECT ELT(10, 'A', 'B', 'C', 'D');
23.10.5.Using ELT with data in a table