# Is it possible to get a list of topics in a category read by a specific user?

**URL:** https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [Abril 26, 2017, 2:02pm UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641 "2017-04-26T14:02:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [Abril 26, 2017, 2:02pm UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/1 "2017-04-26T14:02:45Z")

</div>

I realize this is an oddball request but is it possible, perhaps via a [data explorer](https://meta.discourse.org/t/32566?silent=true) query, to retrieve a full list of posts in a specific category that has been read by a specific user? Is it possible to create a list of topics and posts a user has seen generally? This might be interesting.

My story is that we have a private category which admins are not supposed to be reading. Everyone knows and can live with the fact that we have to have access to it for admin purposes but the understanding is that we mute the category in our prefs and do not actively go seek out messages in that category. Knowing that there’s a paper trail will help us to resist the temptation to do that. 🙂

---

<div class="post-metadata">

### Author: ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)
#### Post date: [Abril 26, 2017, 2:12pm UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/2 "2017-04-26T14:12:38Z")

</div>

Interesting use case - fairly unique I should imagine

Just from a practical point of view I am not sure it would help since the admin could simply impersonate a valid user and read it that way? Or maybe go into Anonymous mode (if you allow that).

Would it be easier to set it up as a group so they can PM each other instead? Not sure what rights admins have to private messages

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [Abril 26, 2017, 2:19pm UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/3 "2017-04-26T14:19:08Z")

</div>

I think admin actions like impersonation are logged.

Anonymous mode wouldn’t work because it’s a private category only accessible to a particular group (plus admins).

Admins can also read PMs - they have access to everything. In any case, we prefer categories and topics to messages.

I’m not really too worried about all this and don’t want to create draconian or big brother-esque oversight of admins, but thought it would be worthwhile to have a way - even if it’s hard to do - to check in case there is ever a concern.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [Abril 26, 2017, 5:12pm UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/4 "2017-04-26T17:12:40Z")

</div>

```sql
SELECT tu.topic_id, tu.last_read_post_number FROM topics 
LEFT OUTER JOIN topic_users AS tu ON topics.id = tu.topic_id 
WHERE topics.category_id = 4 AND tu.user_id = 1 AND tu.last_visited_at IS NOT NULL

```

I guess this is what you are looking for.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [Abril 26, 2017, 5:44pm UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/5 "2017-04-26T17:44:57Z")

</div>

that worked! many thanks. 🌱

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [Maio 11, 2022, 10:23am UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/6 "2022-05-11T10:23:23Z")

</div>

3 posts foram divididos em um novo tópico: [Ler histórico de uma categoria específica](https://meta.discourse.org/t/read-history-for-a-particular-category/226740)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [Maio 11, 2022, 3:49am UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/7 "2022-05-11T03:49:21Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [Maio 11, 2022, 10:25am UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-list-of-topics-in-a-category-read-by-a-specific-user/61641/10 "2022-05-11T10:25:03Z")

</div>


