Home >Database >Mysql Tutorial >When MySQL LOCATE() function returns NULL as output?
When the value of the first parameter (i.e. substring) or the second parameter (i.e. substring) is NULL, it will return NULL as output. The following example will demonstrate it -
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)
The above is the detailed content of When MySQL LOCATE() function returns NULL as output?. For more information, please follow other related articles on the PHP Chinese website!