# Who messaged the most?

**URL:** <https://meta.discourse.org/t/who-messaged-the-most/63963>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [2017年六月5日 14:37 UTC](https://meta.discourse.org/t/who-messaged-the-most/63963 "2017-06-05T14:37:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)\
**Post date:** [2017年六月5日 14:58 UTC](https://meta.discourse.org/t/who-messaged-the-most/63963/3 "2017-06-05T14:58:08Z")

</div>

Make sure you have the [Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566) plugin installed, navigate to Admin → Plugins → [Data Explorer](https://meta.discourse.org/t/32566?silent=true), create a new query and paste in this SQL code:

```sql
SELECT user_id, count(*) AS message_count
FROM topics
WHERE archetype = 'private_message' AND subtype = 'user_to_user'
AND age(created_at) < interval '7 days'
GROUP BY user_id
ORDER BY message_count DESC

```

This will show you all users that have messaged someone in the last 7 days, including the number of messages they have created. (Only new messages count, replies don’t.)

To see the messages, simply click their username and go to Messages → Sent 🙂

---

_[View the full topic](https://meta.discourse.org/t/who-messaged-the-most/63963)._
