WebThe FIND_IN_SET() function returns the position of a string within a list of strings. Syntax. FIND_IN_SET(string, string_list) Parameter Values. Parameter Description; string: Required. The string to search for: string_list: Required. The list of string values to be searched (separated by commas) WebJan 12, 2024 · FIND_IN_SET () equivalent in SQL Server. SELECT * FROM users WHERE uid IN (SELECT doctors FROM MainPage WHERE Valid=1) When I am running the above query, it is only resulting 1 row which is for uid = 1, however I wanted all the 5 rows. So in MySQL I used this query: SELECT * FROM users JOIN MainPage ON FIND_IN_SET …
MySQL FIND_IN_SET() 函数 - W3Schools
WebAug 19, 2024 · MySQL FIND_IN_SET () returns the position of a string if it is present (as a substring) within a list of strings. The string list itself is a string contains substrings separated by ‘,’ (comma) character. This function returns 0 when search string does not exist in the string list and returns NULL if either of the arguments is NULL. Webfind_in_set()和like的区别: 在mysql中,有时我们在做数据库查询时,需要得到某字段中包含某个值的记录,但是它也不是用like能解决的,使用like可能查到我们不想要的记录,它比like更精准,这时候mysql的FIND_IN_SET函数就派上用场了,下面来看一个例子。 don t feed the goat tumblr
find_in_set()和in()比较 - 丿似锦 - 博客园
Web最佳答案. FIND_IN_SET () 仅可用于搜索以逗号分隔的列表中的单个值,不适用于两个列表。. 您需要为每个值分别调用它。. SELECT * FROM tablename WHERE FIND_IN_SET ( '12', category_id) OR FIND_IN_SET ( '13', category_id) OR FIND_IN_SET ( '15', category_id) 如果您规范化架构而不是使用逗号分隔 ... Web实例. 在字符串列表中搜索"q"(字符串列表为NULL):. SELECT FIND_IN_SET ("q", null); 亲自试一试 ». MySQL 函数. Web注意:mysql字符串函数 find_in_set(str1,str2)函数是返回str2中str1所在的位置索引,str2必须以","分割开。 总结: like是广泛的模糊匹配,字符串中没有分隔符,Find_IN_SET 是 … city of glass book review