Why am I not Socratic already? Good question days stunted by bad questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Have you ever found yourself wondering: "Hey! I ask plenty of good questions! Why don't I have my (|first|second|[0-9]*th) socratic badge already?" Well, it must be those bad questions. If you ask them, your good questions that day won't count; and unfortunately, you're often inspired to ask both good and bad questions on the same day. With this query you'll be able to grit your teeth and curse your impetuousness when you see how many good question days you've wasted this way. And there's just one level of inner joining, to boot! Caveat: This does not take deleted posts into account, so its results can be a bit off, i.e. don't expect your next Socratic badge exactly when your 'actual' value hits the next multiple of 100.

Stack Overflow

Q&A for programmers

-- Have you ever found yourself wondering:
--
--  "Hey! I ask plenty of good questions! Why don't I have my
--  (|first|second|[0-9]*th) socratic badge already?"
--
-- Well, it must be those bad questions. If you ask them, your good
-- questions that day won't count; and unfortunately, you're often
-- inspired to ask both good and bad questions on the same day.
--
-- With this query you'll be able to grit your teeth and curse
-- your impetuousness when you see how many good question days
-- you've wasted this way. And there's just one level of inner joining,
-- to boot!
--
-- Caveat: This does not take deleted posts into account, so
-- its results can be a bit off, i.e. don't expect your next
-- socratic badge exactly when your 'actual' value hits the next
-- multiple of 100.
--

select
    sum(case when up > 0 then 1 else 0 end) as potential,
    sum(case when up > 0 and down > 0 then 1 else 0 end) as stuntend,
    sum(case when up > 0 and down = 0 then 1 else 0 end) as actual
from (
  select
    max(case when score > 0 then 1 else 0 end) as up,
    max(case when score < 1 then 1 else 0 end) as down -- why 1? I don't know; should be 0, but the value doesn't make sense
  from Posts
  where OwnerUserId = ##UserId## and PostTypeId = 1 -- a question
  group by CONVERT(VARCHAR(10), creationDate, 111) 
) question_days;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results