Q&A about the site for information security professionals
SELECT TagName, ROUND( CAST(PostCount AS DECIMAL) / (SUM(PostCount) OVER ()) * 100, 2 ) AS MarketShare FROM ( SELECT COUNT(*) PostCount, t.TagName AS TagName FROM Posts p JOIN PostTags pt ON p.Id = pt.PostId JOIN Tags t ON pt.TagId = t.Id AND t.TagName IN ( 'jpa', 'hibernate', 'mybatis', 'querydsl', 'jooq' ) GROUP BY TagName ) db ORDER BY MarketShare DESC