问题
By vice versa, I mean, check if any of the strings in a column contains the string.
Example:
String a = "Peperoni"
MySQL column:
{
"PPeperoni_123",
"roni",
"hello world"
}
It should return the first 2 rows.
(Note: im looking for the query string for this)
回答1:
Not sure if I understand you correctly, but are you maybe looking for this:
SELECT ... WHERE column LIKE "%string%" OR string LIKE CONCAT("%", column, "%")
回答2:
with Mysql you can use SOUNDS LIKE to find the nearest matches
example
SELECT * FROM table WHERE column SOUNDS LIKE 'Peperoni' ;
来源:https://stackoverflow.com/questions/15862257/how-to-check-if-a-string-contains-any-string-of-a-column-in-mysql-and-vice-versa