Viewing last 25 versions of post by Joey in topic 2021 Derpibooru Community Collab

Joey
Dawnsong - Derpi Supporter
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Flower Trio - Helped others get their OC into the 2023 Derpibooru Collab.
Roseluck - Had their OC in the 2023 Derpibooru Collab.
A Lovely Nightmare Night - Celebrated the 12th anniversary of MLP:FIM!
Cool Crow - "Caw!" An awesome tagger
Tree of Harmony - Drew someone's OC for the 2022 Community Collab
Elements of Harmony - Had an OC in the 2022 Community Collab
Non-Fungible Trixie -
Verified Pegasus - Show us your gorgeous wings!

PM me your cute OCs
"[@Chopsticks":](/forums/art/topics/2021-derpibooru-community-collab?post_id=5015163#post_5015163
"
)  
[
@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.
Reason: clarity
Edited by Joey