First posts for users

1

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

; with firstposts_cte AS (
SELECT
  u.Id AS uid,
  MIN(p.Id) As minid
FROM Users u INNER JOIN Posts p ON p.OwnerUserId=u.Id
GROUP BY u.Id
)

SELECT TOP(##num?100##)
  uid AS [User Link],
  minid AS [Post Link],
  p.ClosedDate
FROM firstposts_cte f INNER JOIN Posts p ON f.minid=p.Id
ORDER BY uid ASC

Enter Parameters

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