Get posts by tag, for the last 7 days.

0

Please login or register to vote for this query.

(click on this box to dismiss)

Cooking Meta

Q&A about the site for professional and amateur chefs

DECLARE @Tag nvarchar(25) = 'c#';

SELECT TOP 100
  Posts.title, Posts.Id, Posts.tags, Posts.CreationDate
FROM Tags
  INNER JOIN PostTags ON PostTags.TagId = Tags.Id
  INNER JOIN Posts ON Posts.Id = PostTags.PostId
  INNER JOIN PostLinks ON Posts.Id = PostLinks.PostId
WHERE
  Posts.PostTypeId = 1 -- Questions
  AND Posts.CreationDate >= DATEADD(day,-7, GETDATE())
ORDER BY Posts.CreationDate DESC

Enter Parameters

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