# Filter topics not answered by Staff

**URL:** https://meta.discourse.org/t/filter-topics-not-answered-by-staff/207739
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [October 31, 2021, 5:27pm UTC](https://meta.discourse.org/t/filter-topics-not-answered-by-staff/207739 "2021-10-31T17:27:49Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)
#### Post date: [November 2, 2021, 11:17am UTC](https://meta.discourse.org/t/filter-topics-not-answered-by-staff/207739/8 "2021-11-02T11:17:41Z")

</div>

Hi Karen,

The query below lists all topics that have not been responded to by the Staff, even if the topic has already received a response from the community.

```sql
--[params]
--date :start_date = 2021-01-01
--date :end_date = 2021-12-31

SELECT t.id topic_id, category_id
FROM topics t
WHERE t.deleted_at IS NULL
  AND t.category_id IS NOT NULL
  AND t.created_at::date BETWEEN :start_date AND :end_date
  AND t.id NOT IN (
    SELECT p.topic_id
    FROM posts p 
    JOIN users u ON p.user_id = u.id
    WHERE u.admin = 't' OR u.moderator = 't'
      AND p.post_number > 1
  )
ORDER BY topic_id DESC

```

---

_[View the full topic](https://meta.discourse.org/t/filter-topics-not-answered-by-staff/207739)._
