Home > Database > Mysql Tutorial > What is the output of the MySQL ELT() function if the index number supplied as a parameter is not an integer?

What is the output of the MySQL ELT() function if the index number supplied as a parameter is not an integer?

PHPz
Release: 2023-09-01 23:25:14
forward
1306 people have browsed it

如果作为参数提供的索引号不是整数,MySQL ELT() 函数的输出是什么?

As we know, the first parameter of the ELT() function must be an integer value, but when the index number we provide is not an integer, MySQL's ELT() function will Return NULL and display a warning.

Example

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

mysql> Show Warnings;
+---------+------+------------------------------------------+
| Level   | Code | Message                                  |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: 'one' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
Copy after login

The above is the detailed content of What is the output of the MySQL ELT() function if the index number supplied as a parameter is not an integer?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template