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)

Internet of Things

Q&A for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors

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

SELECT TOP 100
  Posts.title, Posts.Id, Posts.tags , Posts.ViewCount, Posts.LastActivityDate
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
  Tags.TagName = @Tag AND
  Posts.PostTypeId = 1 -- Questions
  AND Posts.CreationDate >= DATEADD(day,-7, GETDATE())
ORDER BY Posts.CreationDate DESC

Enter Parameters

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