# Receive a badge for a post into a topic containing specific tag

**URL:** <https://meta.discourse.org/t/receive-a-badge-for-a-post-into-a-topic-containing-specific-tag/35397>\
**Category:** Product Support\
**Created:** [9 Novembro , 2015 21:07 UTC](https://meta.discourse.org/t/receive-a-badge-for-a-post-into-a-topic-containing-specific-tag/35397 "2015-11-09T21:07:42Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [22 Abril , 2019 07:03 UTC](https://meta.discourse.org/t/receive-a-badge-for-a-post-into-a-topic-containing-specific-tag/35397/8 "2019-04-22T07:03:55Z")

</div>

Side note that this query will only return the latest post that qualifies. If you have a badge that can be awarded multiple times, use the following version:

```plaintext
SELECT p.user_id, p.created_at granted_at, p.id post_id
FROM badge_posts p
JOIN topics t ON t.id = p.topic_id
JOIN topic_tags tt on t.id = tt.topic_id
JOIN tags on tags.id = tt.tag_id
AND tags.name LIKE 'featured'
and (:backfill OR ( p.id IN (:post_ids) ))
AND p.post_number = 1

```

---

_[View the full topic](https://meta.discourse.org/t/receive-a-badge-for-a-post-into-a-topic-containing-specific-tag/35397)._
