Comments for regular users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Hinduism Meta

Q&A about the site for followers of the Hindu religion and those interested in learning more about Hinduism

SELECT
    c.PostId,
    c.Text AS CommentText
FROM
    Comments c
JOIN
    (
        SELECT p.Id AS PostId
        FROM Posts p
        JOIN Users u ON p.OwnerUserId = u.Id
        JOIN Badges b ON u.Id = b.UserId
        LEFT JOIN Votes v ON v.PostId = p.Id
        WHERE
            u.Reputation BETWEEN 1 AND 1000 -- Reputation score above 20000
            AND b.Class = 3 -- Gold badge (Class 1 represents gold badges)
            AND p.PostTypeId = 1 -- Questions only
            AND p.AnswerCount = 0 -- Questions without answers
            AND YEAR(p.CreationDate) BETWEEN 2020 AND 2020 -- Questions created between 2018 and 2019
        GROUP BY p.Id, p.Tags, u.Reputation, p.ViewCount, YEAR(p.CreationDate)
        HAVING SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) > 0 -- At least one downvote
    ) AS q
    ON c.PostId = q.PostId;

Enter Parameters

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