MySQL FIND_IN_SET Function Returns NULL Output



FIND_IN_SET() function returns NULL as output if any of the argument i.e. either search string or string list, is NULL. Of course, It will also return NULL if both of the arguments are NULL.

Example

mysql> Select FIND_IN_SET(NULL,'Ram is a good boy') AS Result;
+--------+
| Result |
+--------+
| NULL   |
+--------+
1 row in set (0.00 sec)

mysql> SELECT FIND_IN_SET('RAM',NULL)AS RESULT;
+--------+
| RESULT |
+--------+
| NULL   |
+--------+
1 row in set (0.00 sec)

mysql> SELECT FIND_IN_SET(NULL,NULL);
+------------------------+
| FIND_IN_SET(NULL,NULL) |
+------------------------+
|                   NULL |
+------------------------+
1 row in set (0.00 sec)
Updated on: 2020-06-20T08:46:53+05:30

294 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements