Hello i have a question about mysql json_extract function.
there are two tables;
users
+------------------------------------+
| id | email |
+------------------------------------+
| 1 | [email protected] |
+------------------------------------+
| 2 | [email protected] |
+------------------------------------+
room
+----------------------------------------------------------------------------------+
| id | invited(json type) |
+----------------------------------------------------------------------------------+
| 1 | {"invite": [{"To": "[email protected]"}, {"To": "[email protected]"}]}
+----------------------------------------------------------------------------------+
i want to get invited users from room table. so i tried
SELECT A.id, A.email
FROM users A JOIN room B ON
(A.email = json_extract(B.invited,'$.invite[*].To')
but json_extract() return
["[email protected]", "[email protected]"]
If I use 'json_extract(B.invited,'$.invite[0].To')'
it is possible to get one. but can't get several users.
is there any possible way?