Site icon Amelt.net

How to create SQLite with LIKE and Get forward/backward/partial match data

Amelt

Amelt

This post is also available in: 日本語 (Japanese)

This post is about how to get forward/backward/partial match data by fuzzy matching using SQLite with WHERE or LIKE.
As for the full text search method of SQLite, there is a full text search module called FTS in SQLite.

SQLite partial match search (fuzzy search)

If you want to do partial match search(fuzzy search) for the string 'abc' in SQLite.

SELECT * FROM Your-Table-Name WHERE Your-Column-Name LIKE '%abc%'

SQLite forward search (fuzzy search)

If you want to do forward match search(fuzzy search) for the string 'abc' in SQLite.

SELECT * FROM Your-Table-Name WHERE Your-Column-Name LIKE 'abc%'

SQLite backward match search(fuzzy search)

If you want to do backward match search(fuzzy search) for the string 'abc' in SQLite.

SELECT * FROM Your-Table-Name WHERE Your-Column-Name LIKE '%abc'
No tags for this post.