SELECT Q.Id AS QuestionId, Q.Title, Q.Body AS QuestionBody,

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

-- 选择问题帖子和相关的回答
SELECT
    Q.Id AS QuestionId,
    Q.Title,
    Q.Body AS QuestionBody,
    Q.CreationDate AS QuestionDate,
    FIRST_A.Id AS FirstAnswerId,
    FIRST_A.Body AS FirstAnswerBody,
    FIRST_A.CreationDate AS FirstAnswerDate,
    ACC_A.Id AS AcceptedAnswerId,
    ACC_A.Body AS AcceptedAnswerBody,
    ACC_A.CreationDate AS AcceptedAnswerDate

FROM
    Posts Q
OUTER APPLY (
    SELECT TOP 1 *
    FROM Posts A
    WHERE A.ParentId = Q.Id
    ORDER BY A.CreationDate
) AS FIRST_A
OUTER APPLY (
    SELECT *
    FROM Posts A
    WHERE A.Id = Q.AcceptedAnswerId
) AS ACC_A

WHERE
    Q.PostTypeId = 1 
    AND Q.CreationDate >= '2024-04-07'
ORDER BY
    Q.CreationDate;

Enter Parameters

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