| | |
member group query
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2005
Posts: 1
Reputation:
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
![]() |
Similar Threads
- Disable CD-ROM drive through Group Policy Win 2000 (Windows NT / 2000 / XP)
- 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
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop legal license licensing linux maintenance mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





