I have users table with json type attributes column:
Example value:
attributes: {"connection": "HTTP"},
attributes: {"connection": "API"}
When I tried get using WHERE IN() with one param all works correctly:
SELECT * FROM users WHERE JSON_EXTRACT(attributes, '$.connection') IN ("HTTP");
But when I tried with multiple value it's doesn't work for me:
SELECT * FROM users WHERE JSON_EXTRACT(attributes, '$.connection') IN ("API", "HTTP");
In this case return nothing. How I can get users which has one of defined connections inside WHERE IN() values?
JSON_EXTRACT(attributes, '$.connection')from the records you think should match and verified you are getting what you expect?MySQL 8but my version isMySQL 5.7and therefore doesn't work. How can this be done in this version? @ysth