What MySQL ELT() function returns if we the index number, provided as an argument, is less than 1?

MySQLMySQLi Database

MySQL ELT() function returns NULL as output if the index number provided as argument is less than Following is an example to make it clearer −

Example

mysql> Select ELT(0,'Ram','is','a','good','boy')As Result;
+--------+
| Result |
+--------+
| NULL   |
+--------+
1 row in set (0.00 sec)

mysql> Select ELT(-1,'Ram','is','a','good','boy')As Result;
+--------+
| Result |
+--------+
| NULL   |
+--------+
1 row in set (0.04 sec)

As we can see the index number is less than 1 in both the examples above, hence MySQL returns NULL.

raja
Published on 20-Feb-2018 06:37:06
Advertisements