Reputation: 8705
I have json column with following data:
[{"option_id": 1, "category_id": 1}, {"option_id": 2, "category_id": 2}]
I am trying to find records with option_id = 1
This is query I am trying:
select count(*) as aggregate from `complaint_forms`
where json_contains(`outcome_options`, '1', '$."option_id"')
Count is 0. What am I doing wrong here?
Upvotes: 0
Views: 1242