Users by location LIKE 2 tags !

0

Please login or register to vote for this query.

(click on this box to dismiss)

SharePoint

Q&A for SharePoint enthusiasts

SELECT us.id [User Link],
       us.DisplayName [Name],
       us.Reputation,
       us.Location,
       tuser.Score [Tag Score],
       tuser.Answers [Tag Answers]
        
FROM Users us

JOIN 
(SELECT
  Answers.OwnerUserId AS UserId,
  SUM(Answers.Score) AS Score,
  COUNT(*) AS Answers
     FROM Tags 
    JOIN PostTags ON Tags.Id = PostTags.TagId
    JOIN Posts ON Posts.Id = PostTags.PostId  
    JOIN Posts Answers ON Answers.ParentId = Posts.Id 
   WHERE Tags.TagName LIKE '%##TagName1##%' OR Tags.TagName LIKE '%##TagName2##%'
  GROUP BY Answers.OwnerUserId
) tuser ON tuser.UserId = us.Id

WHERE
  UPPER(us.Location) like UPPER('%##Location?israel##%') AND
  Reputation > ##MinimumReputation:int?1000## AND
  Answers >= ##MinimumTagAnswers:int?10##
ORDER BY Reputation DESC

Enter Parameters

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