Welcome to Geeklog, Anonymous Friday, April 26 2024 @ 09:23 pm EDT

Geeklog Forums

SQL Listing Users who are Members of Group


Status: offline

jlhughes

Forum User
Full Member
Registered: 04/25/02
Posts: 154
OK, I'm suffering a brain freeze. I want to list all of the users who are members of a particular group. Lets say the group name is teamone and ID for teamone is 12. What would my SQL look like to return a result of UserNames and User IDs (uids) that are members of teamone? Thanks in advance, John Hughes
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
John, you can try this: SELECT uid, username, grp_id, grp_name, grp_descr FROM gl_groups, gl_group_assignments, gl_users WHERE ug_main_grp_id = grp_id AND gl_users.uid = gl_group_assignments.ug_uid AND grp_id = 12
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

jlhughes

Forum User
Full Member
Registered: 04/25/02
Posts: 154
Perfect. Thanks a whole lot. John Hughes
 Quote

All times are EDT. The time is now 09:23 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content