How to search for a substring in SQLite?

前端 未结 3 886
暖寄归人
暖寄归人 2021-02-05 01:13

Whats the most efficient way to search for a sub string in SQLite?

I\'m looking at the LIKE operator.

Do I have the right idea? Has this worked well for you?

3条回答
  •  無奈伤痛
    2021-02-05 01:25

    You can use LIKE, but it gets really slow if the pattern you're searching for starts with '%' -- i.e., if the substring you're looking for isn't necessarily at the beginning of the field.

    If you need to do such searches, consider using FTS3, which makes full-text searching considerably more efficient.

提交回复
热议问题