Question 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Esperanto Language Meta

Q&A about the site for teachers and students of the Esperanto language

WITH PostsWithTags AS (
    SELECT 
        PostTags.PostId,
        COUNT(PostTags.TagId) AS TagCount
    FROM PostTags
    GROUP BY PostTags.PostId
    HAVING COUNT(PostTags.TagId) >= 5
)

SELECT 
    STRING_AGG(Tags.TagName, ', ') AS Tags,
    COUNT(Tags.TagName) AS NumberOfTags,
    Posts.Id AS PostId,
    Posts.OwnerUserId AS UserId,
    Posts.Body AS PostBody
FROM Posts
JOIN PostsWithTags ON Posts.Id = PostsWithTags.PostId
JOIN PostTags ON Posts.Id = PostTags.PostId
JOIN Tags ON PostTags.TagId = Tags.Id
GROUP BY Posts.Id, Posts.OwnerUserId, Posts.Body
ORDER BY Posts.Id;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results