Home  >  Article  >  Database  >  What does the MySQL ELT() function return if the index number we provide as parameter is less than 1?

What does the MySQL ELT() function return if the index number we provide as parameter is less than 1?

WBOY
WBOYforward
2023-09-16 16:09:061193browse

如果我们作为参数提供的索引号小于 1,MySQL ELT() 函数会返回什么?

MySQL ELT() function will return NULL as output if the index number provided as parameter is less than: Below 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 in both examples above is less than 1, so MySQL returns NULL.

The above is the detailed content of What does the MySQL ELT() function return if the index number we provide as parameter is less than 1?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete