Users with X among their top 3 tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

Philosophy Meta

Q&A about the site for those interested in the study of the fundamental nature of knowledge, reality, and existence

WITH TagsUsers AS
(
  SELECT
    ROW_NUMBER() OVER(PARTITION BY u.Id ORDER BY COUNT(t.Id) DESC) AS #,
    u.Id AS [User Link],
    t.TagName AS Tag,
    COUNT(t.Id) AS Answers#
  FROM
    (((Posts AS q 
    INNER JOIN
    Posts AS a  
    ON a.ParentId = q.Id)
    INNER JOIN
    PostTags AS pt
    ON pt.PostId = q.Id)
    INNER JOIN
    Tags AS t
    ON t.Id = pt.TagId)
    INNER JOIN
    Users AS u
    ON u.Id = a.OwnerUserId
  WHERE
    u.Location LIKE '%[Dd]enmark%'
    OR u.Location LIKE '%[Cc]openhagen%'
  GROUP BY
    u.Id, t.TagName
)
SELECT
  ROW_NUMBER() OVER(ORDER BY Answers# DESC),
  [User Link],
  Answers#
FROM 
  TagsUsers
WHERE
  # BETWEEN 1 AND 3 AND
  Tag LIKE '%angular%' AND
  Tag NOT LIKE '%angularjs%'

Enter Parameters

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