Ability to query on role field contains user with specific group

Gervase Markham gerv at mozilla.org
Thu Jan 8 21:47:49 UTC 2004


Kalaveshi, Adrian wrote:
> I've been racking my brains all morning trying to come up with a SQL query
> to give me a list of bugs who's "assigned_to" value is equal to a member of
> group "x".  I know that this probably isn't the proper forum, but I was
> hoping that one of you SQL experts might be able to help me out.

I'm no SQL expert, but:

SELECT bugs.bug_id FROM bugs, user_group_map, groups WHERE 
bugs.assigned_to = user_group_map.user_id AND user_group_map.group_id = 
groups.id AND groups.name = 'gervgroup' GROUP BY bugs.bug_id;

Gerv



More information about the developers mailing list