select top 1 pts.tags from (select pt.postid, string_agg(...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Webmasters

Q&A for pro webmasters

select top 1 pts.tags
	  from (select pt.postid,
				   string_agg(t.tagname, ',') within group (order by t.id) as tags
			  from posttags pt
				   inner join tags t on pt.tagid = t.id
			 group by pt.postid
			having count(pt.tagid) > 1
		   ) pts
	 group by pts.tags
	 order by count(pts.postid) desc;

Enter Parameters

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