

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
When MySQL LOCATE() function returns NULL as the output?
It will return NULL as the output when the value of either first argument i.e. substring or the value of second argument i.e. substring is NULL. Example below will demonstrate it −
Example
mysql> Select LOCATE(NULL,'Ram is a good boy')As Result; +--------+ | Result | +--------+ | NULL | +--------+ 1 row in set (0.00 sec) mysql> Select LOCATE('Ram',NULL)As Result; +--------+ | Result | +--------+ | NULL | +--------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- When MySQL FIND_IN_SET() function returns NULL as output?
- When MySQL IN() function returns NULL?
- When MySQL MAKE_SET() function returns NULL?
- When MySQL SUBSTRING_INDEX() function returns the same string, provided in the argument, as output?
- Which function in MySQL returns the same output as BIN() function?
- When a MySQL arithmetic expression returns NULL?
- Which MySQL functions work as similar as LOCATE() function?
- Which MySQL function returns a specified number of characters of a string as output?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- What MySQL returns if the argument of QUOTE() function is NULL?
- 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 COALESCE() function returns if it has a blank, but not NULL, as the first argument?
- What MySQL returns if the first argument of INTERVAL() function is NULL?
- What MySQL EXPORT_SET() function returns if any of the argument is NULL?
- What MySQL returns if the search string, provided in FIELD() function, is NULL?
Advertisements