SELECT p.Id AS QuestionId, p.Title AS QuestionTitle, p.Ta...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drones and Model Aircraft Meta

Q&A for experienced flyers, pilots, and builders of drones and model aircraft

SELECT 
    p.Id AS QuestionId,
    p.Title AS QuestionTitle,
    p.Tags AS TagSet,
    CASE 
        WHEN CHARINDEX('><', p.Tags) > 0 THEN LEFT(p.Tags, CHARINDEX('><', p.Tags) - 1)
        ELSE p.Tags
    END AS PrimaryTag, -- Extracts the first tag or the whole tag if there's only one
    p.ViewCount AS TotalViews, -- Total views of the question
    p.OwnerUserId AS QuestionUserId, -- User ID of the person who asked the question
    u.Reputation AS QuestionUserReputation, -- Reputation of the question asker
    p.CreationDate AS QuestionCreationTime -- When the question was created
FROM 
    Posts p
JOIN 
    Users u ON p.OwnerUserId = u.Id -- Join to fetch user details
WHERE 
    p.PostTypeId = 1 -- PostTypeId 1 indicates questions
    AND p.AcceptedAnswerId IS NULL -- Filters out questions with an accepted answer
    AND p.CreationDate >= '2015-12-01' 
    AND p.CreationDate < '2024-12-02'; -- Filters questions between Dec 1, 2015, and Dec 1, 2024

Enter Parameters

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