SELECT qu.QID, a.Id AS AID, a.CreationDate AS ACreationDa...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Beer, Wine & Spirits Meta Stack Exchange

Q&A for alcoholic beverage aficionados and those interested in beer, wine, or spirits

SELECT 
	qu.QID,
	a.Id AS AID,
    a.CreationDate AS ACreationDate,
	u.Reputation,
	u.upVotes,
	u.downVotes
FROM
	(SELECT 
		q.Id AS QID,
		MIN(a.CreationDate) AS AMinCreationDate
	FROM
		Posts q
		JOIN
		Posts a
		ON (q.Id = a.ParentId)
	WHERE
		q.PostTypeId = 1 AND
		q.ClosedDate IS NULL AND
		(a.Id IS NULL OR q.OwnerUserId <> a.OwnerUserId) AND
		q.CreationDate >= '2017-10-15 00:00:00.0' AND
		q.CreationDate < '2017-10-22 00:00:00.0' 
	GROUP BY
		q.Id
	) qu
	JOIN
	Posts a
	ON (qu.QID = a.ParentId)
	JOIN
	Users u
	ON (a.OwnerUserId = u.Id)
WHERE
	a.CreationDate = qu.AMinCreationDate
ORDER BY 
	qu.QID

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results