Standard Devation of RepPerPost

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

DECLARE @MinRep as Integer
DECLARE @MaxRep as Integer
DECLARE @MinPostCount as Integer


SET @MinRep = ##MinRep:int##
SET  @MaxRep = ##MaxRep:int##
SET @MinPostCount = ##MinPostCount:int##


SELECT 
AVG(repperpost) AVG_repPerpost,
STDEV(repperpost) std_repPerpost
FROM(

SELECT 
        
        
        CAST ( u.Reputation as Decimal(25,5)) / CAST(Count(*) as Decimal(10,5))
        repperpost
        
FROM
       posts p
       INNER JOIN Users U
       ON p.OwnerUserId = u.id
WHERE 
u.reputation between @MinRep and @MaxRep 

       

GROUP BY 
        p.OwnerUserId,
        u.Reputation
        
HAVING
        Count(*)  >= @MinPostCount
    
) as t

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached