I got the two following tables
In the 'items' table, desc column is a JSON array
Table items
+--------+--------+-------+
|item_id | name | json |
+--------+--------+-------+
| 1 | Item 1 | [1,2] |
+--------+--------+-------+
Table descriptions
+----+-------------+
| id | description |
+----+-------------+
| 1 | First desc |
+----+-------------+
| 2 | Second desc |
+----+-------------+
I would like to retrieve all the descriptions for a prticular id.
I have tried this, with no luck:
SELECT id, description
FROM descriptions
WHERE id IN (SELECT JSON_EXTRACT(json, '$[*]')
FROM items
WHERE item_id=1)