# Data Explorer query help: metrics to understand unique individual participants

**URL:** <https://meta.discourse.org/t/data-explorer-query-help-metrics-to-understand-unique-individual-participants/72385>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [19.Октябрь.2017 02:32:40 UTC](https://meta.discourse.org/t/data-explorer-query-help-metrics-to-understand-unique-individual-participants/72385 "2017-10-19T02:32:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [19.Октябрь.2017 11:34:06 UTC](https://meta.discourse.org/t/data-explorer-query-help-metrics-to-understand-unique-individual-participants/72385/2 "2017-10-19T11:34:06Z")

</div>

I thought this would be really complicated, but turns out there’s a handy “participant\_count” column in the database 🙂

### Top topics by number of unique participants over the last year

```plaintext
-- [params]
-- string :interval = 1 year

SELECT id as topic_id, participant_count  
FROM topics
WHERE bumped_at >= CURRENT_DATE - INTERVAL :interval
ORDER BY participant_count DESC

```

### Average number of unique participants over the last year

```plaintext
-- [params]
-- string :interval = 1 year

SELECT avg(participant_count)
FROM topics
WHERE bumped_at >= CURRENT_DATE - INTERVAL :interval

```

---

_[View the full topic](https://meta.discourse.org/t/data-explorer-query-help-metrics-to-understand-unique-individual-participants/72385)._
