# 向管理员公开类别和组ID

**URL:** <https://meta.discourse.org/t/expose-category-and-group-ids-to-admins/121428>\
**Category:** Feature\
**Created:** [2019 年6 月 26 日 19:44 UTC](https://meta.discourse.org/t/expose-category-and-group-ids-to-admins/121428 "2019-06-26T19:44:13Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

作者： ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
发布日期： [2019 年6 月 26 日 23:18 UTC](https://meta.discourse.org/t/expose-category-and-group-ids-to-admins/121428/3 "2019-06-26T23:18:45Z")

</div>

> [@outofthebox](#):
>
> I think it would make it easier for admins to edit [data explorer](https://meta.discourse.org/t/32566?silent=true) queries if it was easier to find Category and Group IDs.

For [Data Explorer](https://meta.discourse.org/t/32566?silent=true) queries, you can use a pattern similar to the `WHERE` statement in this query to avoid having to lookup category or group ids:

```sql
--[params]
-- string :category_name

SELECT
id AS topic_id
FROM topics t
WHERE t.category_id = (SELECT id FROM categories WHERE name = :category_name)

```

---

_[View the full topic](https://meta.discourse.org/t/expose-category-and-group-ids-to-admins/121428)._
