6 month old first questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Returns each user's first question, with the most recent posts first.

Ask Ubuntu

Q&A for Ubuntu users and developers

WITH MidResults AS (
    SELECT Id, 
           OwnerUserId, 
           CreationDate, 
           Score,
           ClosedDate,
           ROW_NUMBER() OVER(PARTITION BY OwnerUserId 
                                 ORDER BY CreationDate ASC) AS rank
      FROM Posts
      WHERE Posts.PostTypeId = 1 -- questions
      )
SELECT TOP ##number?200##
  Id AS [Post Link],
  OwnerUserId AS [User Link],
  CreationDate,
  Score,
  CASE WHEN ClosedDate IS NOT NULL THEN 'Closed' ELSE NULL END
FROM MidResults
WHERE MidResults.rank = 1 and CreationDate < DATEADD(month, -6, GETDATE())
ORDER BY CreationDate DESC

Enter Parameters

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