SELECT c.Id AS [Comment ID], c.UserId AS [Comment User ID],

0

Please login or register to vote for this query.

(click on this box to dismiss)

Language Learning

Q&A for students, teachers, polyglots, and anyone interested in the techniques of second-language acquisition

SELECT
    c.Id AS [Comment ID],
    c.UserId AS [Comment User ID],
    c.Text AS [Comment Text],
    c.Score AS [Comment Score],
    c.CreationDate AS [Comment Creation Time],
    cu.Id AS [Comment User ID],
    cu.Reputation AS [Comment User Reputation],
    cu.Location AS [Comment User Location],
    cu.Views AS [Comment User Views],
    cu.UpVotes AS [Comment User Upvotes],
    cu.DownVotes AS [Comment User Downvotes],
    p.Id AS [Post ID],
    p.Title AS [Post Title],
    p.Body AS [Post Body],
    pu.Id AS [Post User ID],
    pu.Reputation AS [Post User Reputation],
    pu.Location AS [Post User Location],
    pu.Views AS [Post User Views],
    pu.UpVotes AS [Post User Upvotes],
    pu.DownVotes AS [Post User Downvotes]
FROM
    Comments c
JOIN
    Users cu ON c.UserId = cu.Id -- Join to get comment user details
JOIN
    Posts p ON c.PostId = p.Id
JOIN
    Users pu ON p.OwnerUserId = pu.Id -- Join to get post user details
WHERE
    c.CreationDate >= '2024-04-01' AND c.CreationDate < '2024-04-08'
    AND p.CreationDate < '2024-04-01' -- Ensure post creation date is not within the specified range
ORDER BY
    c.CreationDate;

Enter Parameters

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