I have a comma separated fields in my table (Sqlite):
And trying to make a query:
SELECT * FROM products WHERE 1=1 AND category IN (5)
Result:
Execution finished without errors.
Result: 0 rows returned in 19ms
At line 1:
SELECT * FROM products WHERE 1=1 AND category IN (5)
Question:
How could I get the right data?
Thanks.
>Solution :
SELECT *
FROM products
WHERE category like '5,%'
OR category like '%,5'
OR category = '5'
OR category like '%,5,%'
