MySQL: ss and ß in LIKE
Is there any solution that MySQL can automatically process ss
and ß
in the operators LIKE
? In an equals statement, =
it works, but we have a search text box, so this term is not equal to the search data in the database.
For only changing the database collation, the problem is not solved because it will only work for equal operators ( =
).
You can use REPLACE()
in the field you are comparing. Something like that:
WHERE REPLACE(YourField, 'ß', 'ss') LIKE '%ss'
We can also use substring_index and the syntax SUBSTRING_INDEX (str, delim, count)
update table set feildName1=CONCAT(SUBSTRING_INDEX(feildName, 'ß', 1),"ss",SUBSTRING_INDEX(feildName, 'ß', -1)) where condtion;