如何使用 LIKE 通配符在列中搜索(不區分大小寫)? - How can I search (case-insensitive) in a column using LIKE wildcard?

問題:

I looked around some and didn't find what I was after so here goes.我環顧四周,沒有找到我想要的東西,所以就這樣了。

SELECT * FROM trees WHERE trees.`title` LIKE  '%elm%'

This works fine, but not if the tree is named Elm or ELM etc...這工作正常,但如果樹被命名爲 Elm 或 ELM 等,則不行...

How do I make SQL case insensitive for this wild-card search?如何使此通配符搜索的 SQL 不區分大小寫?

I'm using MySQL 5 and Apache.我正在使用 MySQL 5 和 Apache。


解決方案:

參考一: https://stackoom.com/question/C4Np
參考二: How can I search (case-insensitive) in a column using LIKE wildcard?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章