# Badge for replies in a specific category

**URL:** https://meta.discourse.org/t/badge-for-replies-in-a-specific-category/276730
**Category:** Data & reporting
**Tags:** sql-triggered-badge
**Created:** [Agosto 27, 2015, 2:51pm UTC](https://meta.discourse.org/t/badge-for-replies-in-a-specific-category/276730 "2015-08-27T14:51:37Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [Agosto 28, 2015, 12:28am UTC](https://meta.discourse.org/t/badge-for-replies-in-a-specific-category/276730/2 "2015-08-28T00:28:40Z")

</div>

```plaintext
SELECT p.user_id user_id, min(p.id) post_id, min(p.created_at) granted_at
FROM badge_posts p
JOIN topics t ON p.topic_id = t.id
WHERE t.category_id = (SELECT id FROM categories WHERE slug = 'introductions')
GROUP BY p.user_id

```

---

_[View the full topic](https://meta.discourse.org/t/badge-for-replies-in-a-specific-category/276730)._
