I wonder if this query is possible using json query.
I need to select all records that have more than 3 values a like.
for example, I have an array [1,2,3,4,5,6]
.
Database record has:
# ["1","2","3","9","4","2"] selected <--- this contains 1,2,3
# ["4","5","6","10","11","12"] selected <--- this contains 4,5,6
# ["1","2","3","4","20","21"] selected <--- this contains 1,2,3,4
4. ["1","2","21","22","23","24"] not selected <-- only contains 1,2`
I was trying this query
select * from `combinations` where json_contains(`combination`, '"0"') and json_contains(`combination`, '"1"') and json_contains(`combination`, '"3"')