SELECT TOP 10 USERS.ID, USERS.DISPLAYNAME, COUNT(POSTS.ID...

0

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 TOP 10 USERS.ID, USERS.DISPLAYNAME, COUNT(POSTS.ID) 
FROM USERS 
LEFT JOIN POSTS ON USERS.ID = POSTS.OWNERUSERID 
WHERE POSTS.ID IS NULL OR POSTS.POSTTYPEID = 1
GROUP BY USERS.ID, USERS.DISPLAYNAME, POSTS.POSTTYPEID 
HAVING COUNT(POSTS.ID) = 0

Enter Parameters

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