FIND_IN_SET used in select
https://www.w3schools.com/sql/func_mysql_find_in_set.asp
The FIND_IN_SET() function returns the position of a string within a list of strings.
- If string is not found in string_list, this function returns 0
- If string or string_list is NULL, this function returns NULL
- If string_list is an empty string (""), this function returns 0
FIND_IN_SET("a", "s,q,l") |
---|
0 |
FIND_IN_SET used in where
https://stackoverflow.com/questions/16209040/mysql-find-in-set-in-where-clause
*Caution, this will cause a full table scan, should be using column IN (value1,value2)
SELECT * FROM employee WHERE FIND_IN_SET(1,comma_separated_column_name)
No comments:
Post a Comment