# דרך קלה לדעת לאילו קבוצות תגיות תג שייך?

**URL:** https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967
**Category:** Support
**Tags:** tags
**Created:** [17 בדצמבר,‏ 2023,‏ 8:43am UTC](https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967 "2023-12-17T08:43:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [17 בדצמבר,‏ 2023,‏ 8:43am UTC](https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967/1 "2023-12-17T08:43:18Z")

</div>

I have a tag that had only administration meaning. Earlier I showed it to every users, but it is basically just noise for them and no one except me was using it.

So I added it to tag group that is visible only for admins. But it was still visible to everyone. First I was thrilled because I found a bug… but no. Only bug was, again, I.

I’ve listed that tag in three other groups too and those were visible to everyone. The tag was hided from ordinary users when I cleaned it away from those other groups, but finding those ”overlapping” tag groups needed too much manual labour 🥴

So, is there an easy way to find out in what groups a tag is added?

SQL of course, but I don’t speak it. And when I asked advise from chatbot I wasn’t specific enough, I reckon.

---

<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: [17 בדצמבר,‏ 2023,‏ 8:55am UTC](https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967/2 "2023-12-17T08:55:29Z")

</div>

I think it tells you on the tag page using the tag wrench(/info button, if a non-staff user):

 ![tag info](https://global.discourse-cdn.com/meta/original/4X/4/e/e/4eeae9b1d196a2eec3b62ffeebd4860a8eb51760.jpeg)

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [17 בדצמבר,‏ 2023,‏ 9:05am UTC](https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967/3 "2023-12-17T09:05:23Z")

</div>

Oh for `are f-words allowed here` sake — how clueless a man can be 🤦‍♂️ I should knew that, but when I was on tag-page I never ever thought that road. A good example of limited thinking.

Well, that’s enough self-punishment for today 😜

But… you can SQL and I bet you can talk to AI better than me. Do we have ability to ask that from the database? And that is pure curiosity, not a need anymore.

---

<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: [17 בדצמבר,‏ 2023,‏ 9:20am UTC](https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967/4 "2023-12-17T09:20:35Z")

</div>

A query that lists tags and has a column of all their associated tag groups?

That should be possible with something like this:

```sql
SELECT 
    t.name AS "Tag",
    STRING_AGG(tg.name, ', ' ORDER BY tg.name) AS "Tag Groups"
FROM tags t
  JOIN tag_group_memberships tgm ON tgm.tag_id = t.id
  JOIN tag_groups tg ON tg.id = tgm.tag_group_id
GROUP BY t.name

```

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [17 בדצמבר,‏ 2023,‏ 9:43am UTC](https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967/5 "2023-12-17T09:43:40Z")

</div>

That’s good starting point. Thanks!

---

<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: [16 בינואר,‏ 2024,‏ 9:43am UTC](https://meta.discourse.org/t/easy-way-to-find-out-what-tag-groups-a-tag-is-belonging/288967/6 "2024-01-16T09:43:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
