
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MySQL ELT Function Behavior with Out-of-Range Index
MySQL ELT() function returns NULL as output if the index number provided as argument is higher than the number of strings. Following is an example to make it clearer −
Example
mysql> Select ELT(6,'Ram','is','a','good','boy')As Result; +--------+ | Result | +--------+ | NULL | +--------+ 1 row in set (0.00 sec)
As we can see that index number is 6 and the list of strings is having only 5 strings. Hence MySQL returns NULL.
Advertisements