M
M
MrColdCoffee2020-04-13 18:30:44
MySQL
MrColdCoffee, 2020-04-13 18:30:44

How to implement sql search in json cell?

Good day!

Unable to implement:

table with posts :
(int) id | (json) tags

entries like this:
1 | [1,2,3,4]
2 | [2,4]
3 | [1]

it is necessary to select the id of posts that have the specified tagsid in tags,

like this query
'SELECT id FROM posts WHERE JSON_VALUE(tags, "$") IN(?) LIMIT 100' , array('1,2,3 ')

Question: How to correctly search for values ​​in a json column?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question