No answer not favorited for a given tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

DECLARE @TagName NVARCHAR(35) = ##tag:string##;

SELECT TOP 50
    q.Id AS [Post Link],
    -- q.Title,
    q.CreationDate,
    q.Score,
    q.ViewCount,
    q.Tags
FROM
    Posts q
JOIN
    PostTags pt ON q.Id = pt.PostId
JOIN
    Tags t ON pt.TagId = t.Id
WHERE
    q.PostTypeId = 1 -- Questions
    AND t.TagName = @TagName
    AND q.AnswerCount = 0
    AND ISNULL(q.FavoriteCount, 0) = 0
    AND q.ClosedDate IS NULL
    AND q.CommunityOwnedDate IS NULL
ORDER BY
    q.CreationDate DESC;

Enter Parameters

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