我们知道ELT()
函数的第一个参数必须是整数值,但是当我们提供的索引号不是整数时,MySQLELT()
函数将返回NULL并显示警告。
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)