•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,879 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,196 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 2190 | Replies: 1
![]() |
•
•
Join Date: Jul 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Disable CD-ROM drive through Group Policy Win 2000 (Windows NT / 2000 / XP / 2003)
- Windows users(group) in network(share file) (Networking Hardware Configuration)
- New Memeber To The Group (Community Introductions)
- is order by and group by the same? (ASP)
- Very Slow Log-in (Viruses, Spyware and other Nasties)
- Help with about:blank hijack (Viruses, Spyware and other Nasties)
- Another About:blank keeps coming back (Viruses, Spyware and other Nasties)
Other Threads in the MySQL Forum
- Previous Thread: setting up MyODBC to connect to MySQL, need help....
- Next Thread: MySQL varchar limitation


Linear Mode