15,032
edits
m (→English issue) |
m (→English issue) |
||
| Line 28: | Line 28: | ||
== English issue == | == English issue == | ||
When the keyword is short and written in English e.g. {{kbd | key = <nowiki>AI</nowiki>}}, the query result using {{kbd | key = <nowiki>column_name LIKE '%AI%'</nowiki>}} may NOT what you want. | When the keyword is short and written in English e.g. {{kbd | key = <nowiki>AI</nowiki>}}, the query result using {{kbd | key = <nowiki>column_name LIKE '%AI%'</nowiki>}} may NOT what you want e.g. Tainan, main, hair and so on. | ||
* (1) Remove all non-alpha-numeric-characters<ref>[https://stackoverflow.com/questions/6942973/how-to-remove-all-non-alpha-numeric-characters-from-a-string mysql - How to remove all non-alpha numeric characters from a string? - Stack Overflow]</ref> (2) REGEXP word boundaries<ref>regex - MySQL REGEXP word boundaries [[:<:]] [[:>:]] and double quotes - Stack Overflow https://stackoverflow.com/questions/18901704/mysql-regexp-word-boundaries-and-double-quotes</ref> e.g. {{kbd | key = <nowiki>(REPLACE(CONVERT(column_name USING ascii), '?', ' ') REGEXP '([[:<:]])AI([[:>:]])')</nowiki>}} | * (1) Remove all non-alpha-numeric-characters<ref>[https://stackoverflow.com/questions/6942973/how-to-remove-all-non-alpha-numeric-characters-from-a-string mysql - How to remove all non-alpha numeric characters from a string? - Stack Overflow]</ref> (2) REGEXP word boundaries<ref>regex - MySQL REGEXP word boundaries [[:<:]] [[:>:]] and double quotes - Stack Overflow https://stackoverflow.com/questions/18901704/mysql-regexp-word-boundaries-and-double-quotes</ref> e.g. {{kbd | key = <nowiki>(REPLACE(CONVERT(column_name USING ascii), '?', ' ') REGEXP '([[:<:]])AI([[:>:]])')</nowiki>}} | ||