I know, there is a lot of case-insensitive collations (e.g. utf8_bin), but besides that, I need a collation that also treats a string as its trimmed version (let's call it "trim-insensitivity"), so it can't distinguish the following two strings: "abc" and " aBc "
Asked
Active
Viewed 83 times
1 Answers
0
try with collate utf8_general_ci

Francesco
- 2,042
- 2
- 19
- 29
-
case-insensitivity + trim-insensitivity for this example means that my query should return all three records of docs, not just one: http://sqlfiddle.com/#!9/e18947/1/0 – Gevorg Melkumyan Jul 29 '20 at 19:30
-
IMHO In Sql the trim-insensitivity is done with like operator, if, by trim-insensity you mean: trim whitespaces from strings and then select the records, you have to treat those strings before the query. i.e. this is not what you need http://sqlfiddle.com/#!9/e18947/4 – Francesco Jul 30 '20 at 07:40
-
I know about LIKE operator, but I don't want to use it since it can't use indexes and eventually will work slow for large data. I thought maybe there is a collation that can be trim-insensitive too so I can develop a search by value (using = operator) – Gevorg Melkumyan Jul 30 '20 at 08:14
-
you need to change the point of view https://stackoverflow.com/questions/31182295/improve-performance-on-mysql-fulltext-search-query – Francesco Jul 30 '20 at 09:39