Q&A for students and teachers of all martial arts
select [tag row], [python], [pandas], [sql] from ( select ptr.postid, trow.tagname [tag row], tcol.tagname [tag col] from posttags ptr inner join tags trow on trow.id = ptr.tagid inner join posttags ptc on ptr.postid = ptc.postid inner join tags tcol on tcol.id = ptc.tagid ) data pivot ( count(postid) for [tag col] in ([python], [pandas], [sql]) ) pvt order by 2 desc