Q&A about the site for members of the workforce navigating the professional setting
SELECT TOP 10 Tags, NumberOfTags, Id AS PostId, OwnerUserId AS UserId, LEFT(Body, 300) AS PostBody FROM ( SELECT Tags, Id, OwnerUserId, Body, (LEN(Tags) - LEN(REPLACE(Tags, ',', ''))) + 1 AS NumberOfTags FROM Posts WHERE Tags IS NOT NULL AND CHARINDEX(',', Tags) > 0 -- Filter out records without commas ) AS FilteredPosts WHERE NumberOfTags >= 5 -- Ensure there are 5 or more tags ORDER BY NumberOfTags DESC;