")
[@Frown Factory":](/forums/art/topics/2021-derpibooru-community-collab?post_id=5015179#post_5015179
)
"
[@Lil_VampireCJ":](/forums/art/topics/2021-derpibooru-community-collab?post_id=5015242#post_5015242
)
I wrote a simple (but very messy) SQL query that can be ran against the site's database to get everything in one go:
[bq]
> SELECT name FROM tags
> WHERE id IN (
> SELECT tag_id
> FROM image_taggings
> WHERE image_id IN (
> SELECT image_id
> FROM image_taggings
> WHERE tag_id = 478530
> )
> AND image_id NOT IN (
> SELECT id
> FROM images
> WHERE hidden_from_users = true
> AND id IN (
> SELECT image_id
> FROM image_taggings
> WHERE tag_id = 478530
> )
> )
> )
> AND (namespace = 'oc' OR namespace = 'artist')
> GROUP BY name;[/bq]
For those who don't speak SQL, it basically gets a list of all tag names where:
- the tag is on an image that is tagged with tag ID 478530 (2020 Community Collab)
- the tag also is on an image that is not deleted
- the tag also has an "artist" or "oc" namespace
There's probably a cleaner and more efficient way to do that, but that's a query that only has to be ran like once or twice a year, so I didn't really care.