The most popular tag of user from Russia with the maximum reputation


Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

with russianUsers as (select * from users where lower(location) like '%russia%'),
     userId as (select id from russianUsers where reputation = (select max(reputation) from russianUsers)),
     idAnswer as (select id from posttypes where name='Answer'),
     answers as (select * from posts where PostTypeid=(select * from idAnswer) and owneruserid=(select * from userId)),
     postids as (select id from posts where Id in (select parentid from answers)),
     tagsmy as (select * from posttags where postid in (select * from postids)),
     groupedTags as (select tagid, count(tagId) as tagCount from tagsmy group by tagid),
     populartagId as (select tagid from groupedTags where tagCount=(select max(tagCount) from groupedTags))
--select TagName
--from Tags
--where Id=(select * from populartagid)
select tagName, tagcount
from groupedtags gt
join Tags on
order by tagcount desc

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results