select * from Users.Users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sports

Q&A for participants in team and individual sport activities

with AllTags as

(
SELECT top 1000 p.Id, replace(v.value, '>', '') as tag
FROM Posts  p
    CROSS APPLY STRING_SPLIT(Tags, '<') v  
    where replace(v.value, '>', '') <> '')

,SortedTags as(
SELECT a.Id, STRING_AGG(a.tag, ', ') WITHIN GROUP (ORDER BY a.tag ASC) AS SortedLine
FROM AllTags a
GROUP BY a.Id)

,GroupedCombination as (
select SortedLine, count(Id) as counts
from SortedTags
group by SortedLine)

select * from GroupedCombination

Enter Parameters

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