# Reply at least once on 50+ topics?

**URL:** https://meta.discourse.org/t/reply-at-least-once-on-50-topics/281551
**Category:** Data & reporting
**Tags:** sql-triggered-badge
**Created:** [December 23, 2019, 11:23pm UTC](https://meta.discourse.org/t/reply-at-least-once-on-50-topics/281551 "2019-12-23T23:23:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [December 23, 2019, 11:23pm UTC](https://meta.discourse.org/t/reply-at-least-once-on-50-topics/281551/1 "2019-12-23T23:23:44Z")

</div>

Hi everyone!

I wanted to ask a hand on a query. I wanted to create a badge granted when someone replies at least once on at least topics.

So far, using different sql queries in this thread I have the easy part : 50 replies

```sql
SELECT user_id, 0 post_id, current_timestamp granted_at 
FROM badge_posts  
WHERE post_number > 1 
AND (:backfill OR user_id IN (:user_ids) OR 0 NOT IN (:post_ids) )
GROUP BY user_id 
HAVING count(*) >= 50

```

But I lack the knowledge to add the trigger that the replies need to be into 50 or more different topics.

If anyone has a clue, I’ll take it

Thanks!
