Для каждого года посчитать процент пользователей из России, задающих вопросы

0

Please login or register to vote for this query.

(click on this box to dismiss)

Anime and Manga

Q&A for anime and manga fans

select year(p.creationdate) as 'year'
--, count(p.id) as 'count of posts'
--, count(u.id) as 'count of users ', 
--count(case when u.location like '%Ru%' then 1 end) as 'count of users from Ru'

from users u
join posts p on p.owneruserid = u.id
join posttypes pt on pt.id = p.posttypeid
where pt.id = 1 
group by year(p.creationdate)
--, u.id
order by year(p.creationdate) desc

Enter Parameters

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