Reputation: 6527
I have a column which has json type arrays like
row1: ["abc", 10, null, true, false]
row2: ["def", 10, null, true, false]
How can i use where
clause to find "abc"
contained rows? My json arrays has no key. They only have values.
select * from myTable where JSON_SEARCH(myColumn,"all","abc")
returns 0 rows
Upvotes: 1
Views: 114
Reputation: 222652
You can use MySQL JSON search function JSON_CONTAINS()
:
where json_contains(myColumn, '"abc"')
Upvotes: 1