Top Users by Country

0

Please login or register to vote for this query.

(click on this box to dismiss)

Created by samliew (http://stackoverflow.com/users/584192/samuel-liew)

Mathematica

Q&A for users of Mathematica

-- https://data.stackexchange.com/stackoverflow/query/edit/761631

SELECT TOP 5
    Users.Id as [User Link]
    , Users.DisplayName
    , COUNT (atags.Id) AS Number_of_Tag_Badges,
    (
        select distinct t.tagname + ', ' AS 'data()' 
        from tags t 
        inner join posttags pt on pt.tagid = t.id
        inner join posts p on pt.postid in (p.id, p.parentid)
        where p.owneruserid = Users.Id
        FOR XML PATH('')
    ) as ksdjkv
   

FROM 
    tags atags
	inner join posttags pt on pt.tagid = atags.id 
	inner join posts p on pt.postid in (p.id, p.parentid)
	INNER JOIN Users ON Users.Id = p.owneruserid
WHERE LOWER(atags.tagname) LIKE 'curl' AND
LOWER(Users.Location) LIKE 'malaysia' 
GROUP BY Users.DisplayName, Users.Id
ORDER BY Number_of_Tag_Badges DESC

--// could PostTags

Enter Parameters

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