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

0

Please login or register to vote for this query.

(click on this box to dismiss)

Project Management

Q&A for project managers

select year(p.creationdate) as 'year', (count(ur.id)/(count(u.id))) as 'count of users'
from posts p 
join users u on p.owneruserid = u.id
left join users ur on p.owneruserid = ur.id
join posttypes pt on pt.id = p.posttypeid
where pt.id = 1 and ur.location like '%Ru%'
group by year(p.creationdate)
order by year(p.creationdate) desc

Enter Parameters

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