In MySql database I have table user
user_id | user_name
--------+----------
1 | Joe
2 | Anna
3 | Max
Table group
group_id | group_name
---------+----------
1 | Red
2 | Blue
3 | Green
Table group_member
group_member_id | user_id | group_id
----------------+---------+---------
1 | 1 | 2
2 | 3 | 2
3 | 1 | 3
3 | 2 | 1
So... Member of the Red group is Anna, member of the Green gorup is Joe and members of the Blue group are Joe and max.
How can I get the list of users and their groups
User | Group
------+------------
Joe | Green, Blue
Anna | Red
Max | Blue