Question 5

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 PostTagCounts AS (
    SELECT 
        P.Id AS PostId,
        P.OwnerUserId AS UserId,
        P.Body AS PostBody,
        COUNT(PT.TagId) AS NumberOfTags
    FROM Posts P
    JOIN PostTags PT ON P.Id = PT.PostId
    GROUP BY P.Id, P.OwnerUserId, P.Body
    HAVING COUNT(PT.TagId) >= 5 
)
SELECT 
    STRING_AGG(T.TagName, ',') AS Tags,
    PTC.NumberOfTags,
    PTC.PostId,
    PTC.UserId,
    PTC.PostBody
FROM PostTagCounts PTC
JOIN PostTags PT ON PTC.PostId = PT.PostId
JOIN Tags T ON PT.TagId = T.Id
GROUP BY PTC.PostId, PTC.UserId, PTC.PostBody, PTC.NumberOfTags;

Enter Parameters

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