Q5

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

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;

Enter Parameters

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