Q5

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

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 meta site
loading Hold tight while we fetch your results