# 凌晨1点至5点创建帖子的徽章

**URL:** <https://meta.discourse.org/t/badge-for-posts-created-between-1-am-and-5-am/178826>\
**Category:** Development\
**Tags:** badges\
**Created:** [2021 年2 月 7 日 22:41 UTC](https://meta.discourse.org/t/badge-for-posts-created-between-1-am-and-5-am/178826 "2021-02-07T22:41:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)\
发布日期： [2021 年2 月 8 日 09:42 UTC](https://meta.discourse.org/t/badge-for-posts-created-between-1-am-and-5-am/178826/2 "2021-02-08T09:42:40Z")

</div>

可以按如下方式进行过滤：

```sql
SELECT 
    user_id, 
    current_timestamp granted_at 
FROM badge_posts p  
WHERE p.created_at::time BETWEEN '01:00' AND '05:00'
GROUP BY user_id 
HAVING count(*) >= 100

```

希望这能帮到您。

---

_[View the full topic](https://meta.discourse.org/t/badge-for-posts-created-between-1-am-and-5-am/178826)._
