What is the best way to implement a substring search in SQL?

前端 未结 4 2159
失恋的感觉
失恋的感觉 2020-12-08 11:55

We have a simple SQL problem here. In a varchar column, we wanted to search for a string anywhere in the field. What is the best way to implement this for performance? Obvio

4条回答
  •  悲&欢浪女
    2020-12-08 12:20

    I you want to match whole words, look at a FULLTEXT index & MATCH() AGAINST(). And of course, take a load of your database server: cache results for a appropriate amount of time for you specific needs.

提交回复
热议问题