WITH AggregatedTags AS ( SELECT pt.postid , STRING_AGG(t....

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

WITH AggregatedTags AS (
SELECT pt.postid ,
           STRING_AGG(t.tagname, ',') WITHIN GROUP (ORDER BY t.id asc) AS tag_combination
    FROM posttags pt
    join tags t on t.id = pt.tagid
    WHERE 1=1
    and pt.postid in (72, 79)
    GROUP BY pt.postid
),
TagCombinationCounts AS (
    SELECT tag_combination,
           COUNT(*) AS combination_count
    FROM AggregatedTags
    GROUP BY tag_combination
)
SELECT tag_combination, combination_count
FROM TagCombinationCounts
ORDER BY combination_count DESC;

Enter Parameters

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