Question asking badges


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for Joomla! administrators, users, developers and designers

with user_questions as (
  select OwnerUserId, count(*) number_asked
  from Posts
  where score > 0
        and PostTypeId = 1
        and OwnerUserId is not null
  group by OwnerUserId

asking_badges as (
  select case 
           when number_asked >= 50 then 1
         end gold,
           when number_asked >= 10 then 1
         end silver,
           when number_asked >= 1  then 1
         end bronze,
           when number_asked is null  then 1
         end none
  from user_questions
       right join Users on OwnerUserId = Id

select count(*) users, 
       sum(gold) gold, 
       sum(silver) silver, 
       sum(bronze) bronze, 
       sum(none) none
from asking_badges

Enter Parameters

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