Branchwell

AI Resource Pro / website · airesourcepro.com / scripts / check-remaining-tags.sql

Raw 345 B on b7854f3692d64213a2fce644d0b5101d3e345b03
1-- Show all posts that still have tags, along with their tag contents
2SELECT
3 id,
4 title,
5 tags,
6 (SELECT array_agg(c.name)
7 FROM post_categories pc
8 JOIN categories c ON c.id = pc.category_id
9 WHERE pc.post_id = posts.id) as categories
10FROM posts
11WHERE tags IS NOT NULL
12AND array_length(tags, 1) > 0
13ORDER BY title;