Usuarios que preguntan mucho y aceptan poco

0

Please login or register to vote for this query.

(click on this box to dismiss)

EOS.IO

Q&A for users and developers of distributed applications built on top of the blockchain operating system, EOS.IO

-- MinNumNotAcceptedQuestions: Número mínimo de preguntas sin aceptar
-- MaxAcceptedQuestions: Número máximo de preguntas con respuesta aceptada

DECLARE @MIN_NOT_ACCEPTED_Q int = ##MinNumNotAcceptedQuestions?10##
DECLARE @MAX_ACCEPTED_Q int = ##MaxAcceptedQuestions?0##

select U.id as [User Link],
       U.DisplayName,
       count(case when P.AcceptedAnswerId is null then 1 else null end) as PreguntasSinAceptar,
       count(case when P.AcceptedAnswerId is not null then 1 else null end) as PreguntasAceptadas,
       U.LastAccessDate as UltimoAcceso
  from Users U
  inner join Posts P
        on U.id = P.OwnerUserId
  where P.PostTypeId = 1 
        and P.AnswerCount > 0 
  group by U.id,
           U.DisplayName,
           U.LastAccessDate
  having count(case when P.AcceptedAnswerId is null then 1 else null end) >= @MIN_NOT_ACCEPTED_Q
         and count(case when P.AcceptedAnswerId is not null then 1 else null end) <= @MAX_ACCEPTED_Q
  order by 3 desc;

Enter Parameters

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