# Rapport maken over groepslidmaatschap?

**URL:** <https://meta.discourse.org/t/making-report-on-group-membership/162174>\
**Category:** Product Support\
**Created:** [26 augustus 2020 om 20:20 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174 "2020-08-26T20:20:22Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)\
**Post date:** [27 augustus 2020 om 08:39 UTC](https://meta.discourse.org/t/making-report-on-group-membership/162174/4 "2020-08-27T08:39:40Z")

</div>

> [@codinghorror](#):
>
> A list of each group, and the members in each group?

If this information is what you need, these queries can help you.

> **LIST NAME GROUPS**
>
> ```
> SELECT 
> g.name group_name,
> user_count
> FROM groups g 
> ORDER BY g.name ASC
> 
> ```

> **LIST GROUP AND MEMBERS**
>
> ```
> -- [params]
> -- string :group_name
> 
> SELECT 
> g.name group_name,
> u.username user_name,	
> gu.owner group_owner
> FROM group_users gu 
> LEFT JOIN groups g ON gu.group_id = g.id
> LEFT JOIN users u ON gu.user_id = u.id
> WHERE user_id > 0
> AND g.name LIKE '%'||:group_name||'%'
> ORDER BY g.name ASC, gu.owner DESC
> 
> ```

> **LIST ALL GROUPS AND MEMBERS**
>
> ```
> SELECT 
> g.name group_name,
> u.username user_name,	
> gu.owner group_owner
> FROM group_users gu 
> LEFT JOIN groups g ON gu.group_id = g.id
> LEFT JOIN users u ON gu.user_id = u.id
> WHERE user_id > 0
> ORDER BY g.name ASC, gu.owner DESC
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/making-report-on-group-membership/162174)._
