Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more
SELECT a.TagId, c.Tagname, b.TagId, d.Tagname, COUNT(*) as CountRelations FROM PostTags AS a JOIN PostTags AS b ON a.PostId = b.PostId JOIN Tags AS c ON c.Id = a.TagId JOIN Tags AS d ON d.Id = b.TagId WHERE a.TagId != b.TagId GROUP BY a.TagId, c.Tagname, b.TagId, d.Tagname ORDER BY CountRelations DESC;