Posts with tags not in favorites

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @TagName nvarchar(600)
DECLARE @UserId INT

SELECT @TagName = ##TagName:string##
SELECT @UserId = ##UserId##

SELECT DISTINCT TOP 100
  Posts.id as [Post Link],
  Posts.CreationDate
FROM Posts
LEFT JOIN Votes ON Posts.ID = Votes.PostId
WHERE 
  Posts.PostTypeId  = 1
  AND Posts.tags LIKE '%' + @TagName +'%' 
  AND Votes.VoteTypeId = 5 
  AND Votes.UserId = @UserId 
ORDER BY Posts.CreationDate DESC

Enter Parameters

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