Posts from user-id with a given tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Martial Arts Meta

Q&A about the site for students and teachers of all martial arts

DECLARE @UserId int = ##UserId##
DECLARE @TagName varchar(35) = ##TagName##
    Select 
     p.id as [Post Link], p.Title, u.*
      FROM Users u
      LEFT JOIN Votes v ON u.Id = v.UserId
      LEFT JOIN PostsWithDeleted p ON p.Id = v.PostId
      LEFT JOIN PostTags pt ON pt.PostId = p.id
      LEFT JOIN Tags t ON pt.TagId = t.id
      where u.Id = @UserId AND t.TagName like @TagName

Enter Parameters

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