Users with many questions in a single tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy

Q&A for science fiction and fantasy enthusiasts

SELECT 
MAX(t.Count) AS TagCount, 
'site://questions/tagged/' + MAX(t.TagName) + '|' + MAX(t.TagName) AS TagLink, 
COALESCE('site://users/' + CAST(p.OwnerUserId AS NVARCHAR) + '|' + u.DisplayName, p.OwnerDisplayName) AS UserLink,
COUNT(p.Id) AS UTQnCount
FROM Tags AS t 
LEFT JOIN PostTags as a ON a.TagId = t.Id 
JOIN Posts AS p ON p.Id = a.PostId 
LEFT JOIN users AS u ON u.Id = p.OwnerUserId
WHERE p.PostTypeId = 1
GROUP BY t.Id, p.OwnerUserId, p.OwnerdisplayName, u.DisplayName
HAVING ##MinCount?40## <= COUNT(p.Id)
ORDER BY MAX(t.Count) DESC, t.Id DESC, COUNT(p.Id) DESC;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results