- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What MySQL returns if the first argument of INTERVAL() function is NULL?
MySQL returns -1 as output if the first argument of INTERVAL() function is NULL. Following example will demonstrate it −
mysql> Select INTERVAL(NULL,20,32,38,40,50,55); +--------------------------------------+ | INTERVAL(NULL,20,32,38,40,50,55) | +--------------------------------------+ | -1 | +--------------------------------------+ 1 row in set (0.00 sec)
It will return -1 even if any of the other arguments is NULL along with the first argument.
mysql> Select INTERVAL(NULL,20,32,NULL,40,50,NULL); +--------------------------------------+ | INTERVAL(NULL,20,32,NULL,40,50,NULL) | +--------------------------------------+ | -1 | +--------------------------------------+ 1 row in set (0.00 sec)
If the first argument is not NULL and any one or more of the other argument is NULL, it will return the index value of greater number (if any).
mysql> Select INTERVAL(50,20,NULL,55,40,50,NULL); +------------------------------------+ | INTERVAL(50,20,NULL,55,40,50,NULL) | +------------------------------------+ | 2 | +------------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- What MySQL returns if the argument of QUOTE() function is NULL?
- What MySQL EXPORT_SET() function returns if any of the argument is NULL?
- What MySQL COALESCE() function returns if it has a blank, but not NULL, as the first argument?
- What MYSQL INTERVAL() function returns if there is no bigger number in the list of arguments than the number at first argument?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- What MySQL MAKE_SET() function returns if the value of the bit is 1 and the first string is NULL?
- What MySQL returns if we use UNIX_TIMESTAMP() function with no argument?
- What MySQL returns if the search string, provided in FIELD() function, is NULL?
- What happens if a NULL argument is provided in MySQL CONV() function?
- What MySQL returns if we use NULL, as both the arguments, as one of the argument and as a separator, in CONCAT_WS() function?
- What MySQL TRIM() function returns if 1st argument(i.e. BOTH, LEADING, TRAILING) is not specified?
- What MySQL ASCII() function returns if I will provide NULL to it?
- When MySQL IN() function returns NULL?
- When MySQL MAKE_SET() function returns NULL?
- What MySQL MAKE_SET() function returns if there are all NULL at the place of strings?

Advertisements