select p.length, avg(p.score) as [Average score], avg(p.v...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select 
  p.length, 
  avg(p.score) as [Average score],
  avg(p.views)/1000 as [Average views/1000],
  avg(pt.tags) as [Average tag count]
from (
  select 
    Id,
    round(len(Title), -1) as length, 
    cast(Score as float) as score,
    cast(ViewCount as float) as views
  from Posts
) p
left join (
  select PostId, cast(count(PostId) as float) as tags 
  from PostTags group by PostId
) pt on p.Id = pt.PostId
group by p.length having count(p.length) > 100
order by p.length asc

Enter Parameters

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