First Questions (answered within 24 hours)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

WITH
  FirstQuestions AS (
    SELECT 
        O.Id AS QuestionID
      , O.OwnerUserId AS UserID
      , O.CreationDate
    FROM Posts O
    WHERE O.PostTypeId = 1 
    AND O.CreationDate = (
      SELECT MIN(I.CreationDate)
      FROM Posts I
      WHERE I.OwnerUserId = O.OwnerUserId
    )
  ),
  FirstAnswers AS (
    SELECT 
        O.ParentId AS QuestionID
      , O.Id AS AnswerId
      , O.OwnerUserId AS UserId
      , O.CreationDate
    FROM Posts O
    WHERE O.PostTypeId = 2 
    AND O.CreationDate = (
      SELECT MIN(I.CreationDate)
      FROM Posts I
      WHERE I.ParentId = O.ParentId
    )
  )
  
SELECT 
    Q.QuestionID AS [Post Link]
  , Q.UserID AS [User Link]
  , Q.CreationDate AS QDate
  , A.AnswerID AS [Post Link]
  , A.UserID AS [User Link]
  , A.CreationDate AS ADate
FROM FirstQuestions Q
  INNER JOIN FirstAnswers A ON A.QuestionID = Q.QuestionID
WHERE A.CreationDate BETWEEN Q.CreationDate AND DATEADD(HOUR,24,Q.CreationDate)

Enter Parameters

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