
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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 Articles
- 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 function returns a specified number of characters of a string as output?
- Which MySQL functions work as similar as LOCATE() function?
- 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 COALESCE() function returns if it has a blank, but not NULL, as the first argument?
- What MySQL EXPORT_SET() function returns if any of the argument is NULL?
- What MySQL returns if the first argument of INTERVAL() 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 returns if the search string, provided in FIELD() function, is NULL?

Advertisements