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
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
find in set,
FIND_IN_SET(),
my sql query,
Mysql find_in_set,
mysql string function,
order by find_in_set,
string functions in mysql
.You can leave a response, or trackback from your own site.