SELECT p.Id AS PostId, p.Title, STRING_AGG(t.TagName, ', ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair

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

SELECT 
    p.Id AS PostId,
    p.Title,
    STRING_AGG(t.TagName, ', ') AS Tags
FROM 
    Posts p
JOIN 
    PostTags pt ON p.Id = pt.PostId
JOIN 
    Tags t ON pt.TagId = t.Id
WHERE 
    p.PostTypeId IN (1, 2) 
GROUP BY 
    p.Id, p.Title
HAVING 
    COUNT(pt.TagId) >= 5
ORDER BY 
    p.Id

Enter Parameters

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