Func 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Biology

Q&A for biology researchers, academics, and students

SELECT P.Id AS [Post Link], R.MaxScore, R.PostType
FROM Posts P
INNER JOIN  (
    SELECT MAX(PO.Score) AS MaxScore, PT.Name AS PostType
    FROM Posts PO
    INNER JOIN PostTypes PT ON PT.Id = PO.PostTypeId 
          AND PT.Id IN (1, 2) -- 1 => Question, 2 => Answer
    WHERE PO.DeletionDate IS NULL 
    GROUP BY PT.Name
    ) R ON R.MaxScore = P.Score;

Enter Parameters

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