Find by tags with grouping

0

Please login or register to vote for this query.

(click on this box to dismiss)

Economics

Q&A for those who study, teach, research and apply economics and econometrics

SELECT Users.Id, DisplayName, EmailHash, Reputation, Location, STRING_AGG(cast(Tags as NVARCHAR(MAX)), CHAR(32)) as Tags
FROM Users 
INNER JOIN PostHistory ph 
	ON ph.UserId = Users.Id 
INNER JOIN posts 
	ON posts.Id = ph.PostId 
    WHERE LOWER(Tags) LIKE LOWER('%##skill1##%') AND LOWER(Tags) LIKE LOWER('%##skill2##%') 
AND LOWER(Location) LIKE LOWER('%##location##%')
GROUP BY Users.Id, DisplayName, EmailHash, Reputation, Location 
ORDER BY Reputation DESC

Enter Parameters

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