Users without a specific badge and their first post/question/answer

1

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

SELECT TOP(##num?500##)
  u.Id AS [User Link],  
  u.CreationDate,
  'site://users/'+CAST(u.id AS varchar)+'?tab=badges' AS [List of Badges], 
  MIN(p.Id) AS [Post Link]
---FROM Users u INNER JOIN Badges b ON b.UserId=u.Id
FROM Users u INNER JOIN Posts p ON (p.OwnerUserId=u.Id) AND (p.PostTypeId in (##types?1,2##))
---types=1,2 - both questions and answer
---types=1 - only questions
---types=2 - only answers
WHERE u.Id NOT IN
  (SELECT u.Id from Users u JOIN Badges b  ON b.userid = u.id and b.name = '##badge?Informed##')
GROUP BY u.Id, u.CreationDate  
ORDER BY u.CreationDate DESC

Enter Parameters

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