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