Most recent post from given set of users

1

Please login or register to vote for this query.

(click on this box to dismiss)

Moderators

Q&A for community managers, administrators, and moderators

;  with recent_cte as
(
select
    u.Id AS UserId,
    MAX(p.Id) AS MaxId
FROM Users u INNER JOIN Posts p ON p.OwnerUserId=u.Id
WHERE u.Id IN (##list##)
GROUP BY u.Id
)

SELECT UserId AS [User Link], MaxId AS [Post Link], p.CreationDate, p.Score
FROM recent_cte inner JOIN Posts p ON MaxId = p.Id
ORDER BY p.CreationDate DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results