I am kind of new in MYSQL and stuck in below problem
I have two tables Users and Groups and have stored group ids in user table like this:
{"ids": ["2", "4"]}
And I am trying to Join Groups table with User to get Group name from it.
I have tried somthing like this:
SELECT user.name, groups.name
FROM user
LEFT JOIN groups
ON JSON_CONTAINS(user.group_ids->'$.ids[*]', CAST(groups.id AS JSON))
but its not working, Please help on this.
Thanks