# Export a list of people who replied to a specific topic

**URL:** <https://meta.discourse.org/t/export-a-list-of-people-who-replied-to-a-specific-topic/68756>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [2017 年 8 月 25 日午前 8:15 UTC](https://meta.discourse.org/t/export-a-list-of-people-who-replied-to-a-specific-topic/68756 "2017-08-25T08:15:39Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![SidV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sidv/32/119460_2.png) [@SidV](https://meta.discourse.org/u/SidV)\
**Post date:** [2017 年 8 月 25 日午後 7:00 UTC](https://meta.discourse.org/t/export-a-list-of-people-who-replied-to-a-specific-topic/68756/8 "2017-08-25T19:00:38Z")

</div>

A little change to optimize that query (if you want to change the topic\_id before execute it)

```sql
-- [params]
-- topic_id :topic_id = 18438
SELECT u.username
FROM badge_posts p
JOIN topics t ON p.topic_id = t.id 
JOIN users u ON p.user_id = u.id
WHERE t.id = :topic_id
GROUP BY p.user_id,u.username 

```

> Note: replace 18438 for some topic\_id from your forum 😊

---

_[View the full topic](https://meta.discourse.org/t/export-a-list-of-people-who-replied-to-a-specific-topic/68756)._
