Skip to content
Advertisement

How to search for a substring in SQLite?

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?

http://www.sqlite.org/lang_expr.html

Thank You.

Advertisement

Answer

Yepper, use Like. Select id from sometable where name like '%omm%' would return any row that had ‘omm’ anywhere in the name column.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement