select top(5) tag_combo, count(1) from (select pttg.PostI...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sustainable Living

Q&A for folks dedicated to a lifestyle that can be maintained indefinitely without depleting available resources

select top(5)
  tag_combo, count(1)
from
  (select
  pttg.PostId
  ,STRING_AGG(pttg.TagId,',') WITHIN GROUP (ORDER BY pttg.TagId ASC) tag_combo
  from PostTags pttg
  group by pttg.PostId) t
group by tag_combo
order by count(1) desc

Enter Parameters

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