Q&A for professional and enthusiast programmers
CREATE TABLE #userQs (userid int, asked int); INSERT #userQs (userid, asked) SELECT q.OwnerUserid, COUNT(q.Id) FROM Posts Q WHERE q.PostTypeId = 1 GROUP BY q.OwnerUserId CREATE TABLE #userClosedQs (userid int, closed int); INSERT #userClosedQs (userid, closed) SELECT q.OwnerUserid, COUNT(q.Id) FROM Posts Q WHERE q.PostTypeId = 1 AND q.ClosedDate IS NOT NULL GROUP BY q.OwnerUserId select #userQs.userid as [User Link], asked, closed, 100 * closed / asked AS "Percent Closed" from #userQs JOIN #userClosedQs on #userQs.userid = #userClosedQs.userid where asked >= 50 ORDER BY "Percent Closed" DESC