Joren Joren - 7 months ago 153
SQL Question

SQLite string contains other string query

How do I do this?

For example, if my column is "cats,dogs,birds" and I want to get any rows where column contains cats?

Answer

Using LIKE:

SELECT *
  FROM TABLE
 WHERE column LIKE '%cats%'