Mysql FIND_IN_SET usage, mysqlfind_in_set
In mysql, FIND_IN_SET is used to determine whether a string contains a comma.
For example
SELECT t. group_id, COUNT (group_id) tsumFROM (SELECT group_id FROM xx WHERE FIND_IN_SET (openid, 'Expect, oarwerrr-2KRah_TklJEomljhlKg, oaSiouEgtr5t5utLFU8-evmkn5BwQ3_c ') AND user_uuid = 'xxxxxxxxxxxxxx') tGROUP BY group_id;
In this way, we can find the matching data.
The latter is a character with a comma
In java, how does one pass the find_in_set keyword to query mysql?
It can be fully used in java, as long as you pass in a string and use commas to separate it.
Can the first mysql find_in_set parameter be multiple values?
FIND_IN_SET (str, strlist)
If the str string is in the strlist consisting of N substrings, the return value ranges from 1 to N. A string list is a string consisting of several tokens separated by commas. If the first parameter is a constant string and the second parameter is the type SET column, the FIND_IN_SET () function is optimized and computed in bits. If str is not in strlist or strlist is a null string, the return value is 0. If any parameter is NULL, the return value is NULL. This function cannot run normally when the first parameter contains a comma.
This function cannot run normally when the first parameter contains a comma.