# كيفية العثور على المستخدمين الأكثر نشاطًا خلال الشهر الماضي

**URL:** <https://meta.discourse.org/t/how-to-find-the-most-active-users-over-the-last-month/297645>\
**Category:** Data & reporting\
**Created:** [3 مارس 2024، 1:54ص UTC](https://meta.discourse.org/t/how-to-find-the-most-active-users-over-the-last-month/297645 "2024-03-03T01:54:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [3 مارس 2024، 3:29ص UTC](https://meta.discourse.org/t/how-to-find-the-most-active-users-over-the-last-month/297645/2 "2024-03-03T03:29:13Z")

</div>

مرحباً، أهلاً بك 👋

يجب أن يساعد هذا الاستعلام:

```sql
--[params]
--date :start_date = 2024-01-01
--date :end_date = 2024-02-01
--int :top = 10

SELECT
    u.id AS user_id,
    COUNT(*) Count
FROM posts AS p
INNER JOIN users AS u on p.user_id = u.id
INNER JOIN topics AS t ON t.id = p.topic_id AND t.deleted_at ISNULL
WHERE p.created_at::date BETWEEN :start_date AND :end_date
    AND p.deleted_at ISNULL
    AND t.archetype = 'regular'
    AND p.post_type = 1
GROUP BY u.id, u.username
ORDER BY Count DESC
LIMIT :top

```

> [@AaronW](#):
>
> بشكل أساسي ستكون قائمة المستخدمين النشطين في المسؤول → المستخدمين ولكن مع فلتر لشهر؟

أعتقد أن المستخدمين “النشطين” هنا يتم فرزهم حسب تاريخ “آخر ظهور”، وليس المنشورات. 🤔

---

_[View the full topic](https://meta.discourse.org/t/how-to-find-the-most-active-users-over-the-last-month/297645)._
