WITH Combos AS( SELECT pt.PostId, STRING_AGG(t.TagName,',...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Cardano Meta

Q&A for users and developers of the Cardano cryptocurrency ecosystem

WITH Combos AS(
    SELECT pt.PostId, STRING_AGG(t.TagName,',') WITHIN GROUP (ORDER BY TagName ASC) AS TagCombo
    FROM PostTags pt
    JOIN Tags t
    ON pt.TagId = t.Id
    GROUP BY pt.PostId
    ),
    ComboCounts AS (
    SELECT TagCombo, COUNT(PostId) Cnt
    FROM Combos
    GROUP BY TagCombo
    )
SELECT TOP 5 TagCombo, Cnt
FROM ComboCounts
ORDER BY Cnt DESC

Enter Parameters

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