Hello everyone. Thanks in advance for any help.
I have two tables, a groups table and a members table.
The groups table contains the main groups, such as group1, group2, group3.
id | name | description
The members table contains user''s ids and the group id.
id | userid | groupid
I am having difficulty creating a select query that returns all the groups for which a user is a member, including the total amount of members in each group.
Basically, I am trying to achieve the following given a specific user:
GROUP | MEMBERS
Group1 | 12
Group2 | 15
Any ideas how to do this in a single select statement. Thanks very much