I want to do a SELECT
query on a table to get product infos. One field of the table is "productgroup_ids"
. A value looks like this: "3||4||13"
.
This database was not created by me.
So I wrote a Rest service to get the contents in JSON. Now I want products of a specific group e.g. 3 and 4. I get parameter like this: "3,4"
so then the Query should be look like this:
"SELECT name, description FROM products WHERE productgroup_ids in (3,4);"
But then, I have the problem that only the products only with 3 or 4 are in the result.
Can I parse the value of the field with the query, or do I have to read out all products, split a "||"
, compare, and if it contains the requested group, add it to an array?