Hello i have a column table who contains json array with tags in it, I try to find a way to select result who contain some of values in it :
ID | tags |
---|---|
1 | ["test01"] |
2 | ["test02","test03"] |
I try to used JSON_QUERY
AND JSON_VALUE()
:
SELECT *
FROM table_tags
WHERE JSON_QUERY(tags,'$') IN ('test01', 'test02')
return nothing
but with json_value on the first array element [0]
SELECT *
FROM table_tags
WHERE JSON_VALUE(tags,'$[0]') IN ('test01', 'test02')
it return the first one with test01
ID | tags |
---|---|
1 | ["test01"] |
i need to find a way to iterate through json_value tags to find all tags in ('test01', 'test02')