Post Length Rankings

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with Posters as (
    select OwnerUserId as userId,
           count(*) as PostCount,
           max( len(Body)) as MaxCount,
           sum( len(Body)) as CharCount
    from Posts
    group by OwnerUserId
    having count(*) > 1
    )
select Top 1000
       Rank() over (order by CharCount desc) as Rank,
       U.Id as [User Link],
       DisplayName,
       PostCount,
       CharCount,
       MaxCount,
       round(Convert(float, CharCount) / PostCount, 2) as AvgSize
from Posters P,
     Users U
where P.UserId = U.Id
order by CharCount Desc

Enter Parameters

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