Q&A about the site for scientists using computers to solve scientific problems
-- Minor revision! Just testing some stuff. DECLARE @UserID int = ##UserID:int##, @CountedQs decimal -- (total - negative - closed - deleted)/total >= 0.5 -- Can be implemented as "questions NOT (negative, closed, deleted) / total" -- Easier for a dumby like me to do SELECT @CountedQs = count(*) FROM Posts WHERE PostTypeId = 1 -- It's a question AND OwnerUserID = @UserID -- Asked by the user AND Score >= 0 -- And positively scored AND ClosedDate IS NULL -- And not closed -- As far as I can tell, there's no way to check for deleted questions -- so those can't count. Feel free to edit one in if there is. SELECT @CountedQs / CAST(count(*) AS decimal) FROM Posts WHERE PostTypeId = 1 -- It's a question AND OwnerUserId = @UserID -- Asked by our user