No of posts per user


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

--SELECT count(Id) as NumberOfPosts, OwnerUserId
--FROM Posts
--GROUP BY OwnerUserId
--ORDER BY count(Id) asc;

  SELECT u.OwnerUserId, COUNT(p.Id)
FROM Posts AS u
Inner JOIN Posts AS p ON u.OwnerUserId = p.OwnerUserId
GROUP BY u.OwnerUserId

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results