Showing posts with label FIND_IN_SET(). Show all posts
Showing posts with label FIND_IN_SET(). Show all posts
FIND_IN_SET() - Mysql String Function
Posted by Raj
FIND_IN_SET() - Mysql String Function
FIND_IN_SET() is used to find string within another string containing comma-separated values.
FIND_IN_SET() function Return the first occurence of the first string within the second string .
This function Returns 0 when search string does not exist in the string, and Returns NULL if either string is NULL.
Syntax:
FIND_IN_SET (string, list)
Examples:
mysql> SELECT FIND_IN_SET('d','a,b,c,d,e,f,g,h');
-> 4
mysql> SELECT FIND_IN_SET(NULL,'a,b,c,d,e,f,g,h');
-> NULL
mysql> SELECT FIND_IN_SET('z','a,b,c,d,e,f,g,h');
->0
FIND_IN_SET() is used to find string within another string containing comma-separated values.
FIND_IN_SET() function Return the first occurence of the first string within the second string .
This function Returns 0 when search string does not exist in the string, and Returns NULL if either string is NULL.
Syntax:
FIND_IN_SET (string, list)
Examples:
mysql> SELECT FIND_IN_SET('d','a,b,c,d,e,f,g,h');
-> 4
mysql> SELECT FIND_IN_SET(NULL,'a,b,c,d,e,f,g,h');
-> NULL
mysql> SELECT FIND_IN_SET('z','a,b,c,d,e,f,g,h');
->0
