with question_loc as ( select Posts.id as questionID, Loc...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Interpersonal Skills

Q&A for people looking to improve their interpersonal communication skills

with question_loc as (
select Posts.id as questionID, Location
from Posts
join Users on Posts.OwnerUserId=Users.Id
where Posts.PostTypeId=1 and 
(lower(Users.Location) like '%nigeria%' or lower(Users.Location) like '%iceland%')
), 
tag_quest as (
select Tags.TagName as tagName, Posts.id as questionID
from Tags
join PostTags on Tags.Id=PostTags.TagId 
join Posts on PostTags.PostId=Posts.Id
where Posts.PostTypeId=1
)

select tagName,
count(CASE WHEN lower(question_loc.Location) like '%iceland%' THEN 1 ELSE 0 END) as ice_count,
count(CASE WHEN lower(question_loc.Location) like '%nigeria%' THEN 1 ELSE 0 END) as nig_count
from tag_quest
join question_loc on tag_quest.questionID=question_loc.questionID
group by tagName

Enter Parameters

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