开发者

Search in mysql without special symbols when mysql row with special symbols?

开发者 https://www.devze.com 2023-01-12 03:35 出处:网络
Search input: How to format Mysql row: How to - Format How can I find \"How to - Format\" if search input is \"How to format\"?
Search input: How to format 
Mysql row: How to - Format

How can I find "How to - Format" if search input is "How to format"?

In other words how can I sear开发者_如何学运维ch in mysql without special symbols when mysql row with special symbols?

Sorry for my English and thanks for any help.


You can perform a replace on the column you're searching within - at which point all chances of using indexes are lost. Best bet it to enable full-text indexing (see here) and not worry about punctuation etc. Another option is to ensure when you insert data into the table, you have an additional "punctuationless" column and search on that instead - but full-text search is almost certainly the way to go.

0

精彩评论

暂无评论...
验证码 换一张
取 消