SQL newbie needs help :)
One MySQL table is account_user. Field account_group is JSON array with parent ID's from another table account_group
I want to select users, replacing ID's from account_group field with group names from account_group table.
What I have accomplished yet is:
SELECT
account_user.name,
account_user.email,
account_user.hash,
account_group.name AS `group`
FROM account_user
JOIN account_group ON account_group.id MEMBER OF (JSON_EXTRACT(account_group, '$'))
WHERE account_user.email = 'pavlov@kubik.com.ua'
Is it possible to combine such result set, leaving only unique fields and combining group field to comma separated list or JSON array like this ?