rep greater than 1,000? yes -- "established user - You've been around for a while"
Q&A for users of Linux, FreeBSD and other Un*x-like operating systems
-- SELECT TOP 100 -- [Users].Id as [User Link], -- [Users].Reputation, -- DATEDIFF(year, [Users].CreationDate, GETDATE()) "UserAge" -- FROM Users -- WHERE [Users].Reputation > 1000 -- -- temporary sort; really sort by percent -- ORDER BY [Users].Reputation DESC CREATE TABLE #useraccepts (userid int, accepted int); go INSERT #useraccepts (userid, accepted) SELECT q.OwnerUserId, COUNT(q.Id) FROM Posts q WHERE q.PostTypeId = 1 AND q.AcceptedANswerId IS NOT NULL AND q.ClosedDate IS NULL GROUP BY q.OwnerUserId CREATE TABLE #usernotaccepted (userid int, unaccepted int); INSERT #usernotaccepted (userid, unaccepted) SELECT q.OwnerUserId, COUNT(q.Id) FROM Posts q WHERE -- 1 = Question q.PostTypeId = 1 -- Q has an accepted Answer AND q.AcceptedANswerId IS NULL -- Q is not closed AND q.ClosedDate IS NULL GROUP BY q.OwnerUserId SELECT #useraccepts.userid as [User Link], accepted, unaccepted, (100 * accepted / (accepted + unaccepted)) as ratio FROM #useraccepts JOIN #usernotaccepted ON #useraccepts.userid = #usernotaccepted.userid ORDER BY ratio DESC