# Data explorer query nodig om een heel onderwerp te exporteren

**URL:** https://meta.discourse.org/t/need-data-explorer-query-to-export-an-entire-topic/285216
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [11 november 2023 om 21:01 UTC](https://meta.discourse.org/t/need-data-explorer-query-to-export-an-entire-topic/285216 "2023-11-11T21:01:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mr.X\_Mr.X](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mr.x_mr.x/32/126610_2.png) [@Mr.X\_Mr.X](https://meta.discourse.org/u/Mr.X_Mr.X)
#### Post date: [11 november 2023 om 21:01 UTC](https://meta.discourse.org/t/need-data-explorer-query-to-export-an-entire-topic/285216/1 "2023-11-11T21:01:18Z")

</div>

I need a working [data explorer](https://meta.discourse.org/t/32566?silent=true) query to export a whole topic, can someone help. Much appreciated.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [12 november 2023 om 02:50 UTC](https://meta.discourse.org/t/need-data-explorer-query-to-export-an-entire-topic/285216/2 "2023-11-12T02:50:49Z")

</div>

Hi @Mr.X_Mr.X 👋

This should work, just specify the topic id parameter:

```sql
-- [params]
-- int :topic_id = 

select 
  p.id as post_id, 
  p.user_id, 
  p.created_at, 
  p.updated_at, 
  p.like_count, 
  p.raw as post_content 
from 
  posts p 
where 
  p.topic_id = :topic_id

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12 november 2023 om 13:30 UTC](https://meta.discourse.org/t/need-data-explorer-query-to-export-an-entire-topic/285216/3 "2023-11-12T13:30:51Z")

</div>

Depending on afar they want with the data, they might want `p.cooked`.
