Proper Working

0

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

SELECT *
FROM (SELECT ROW_NUMBER() OVER(ORDER BY Id) AS RowNum, *
      FROM (
SELECT p.Id, p.OwnerUserId, p.PostTypeId, p.AcceptedAnswerId, 
'site://questions/' + CAST(p.ParentId AS nvarchar) AS [Parent Link], p.creationDate as [Post Creation Date],
p.DeletionDate, p.Score, p.ViewCount, p.Body, p.AnswerCount, p.CommentCount, p.ClosedDate, 
ph.PostHistoryTypeId, ph.creationDate as [Post History Creation Date],
u.Reputation,u.DisplayName,u.LastAccessDate,u.Location,u.AboutMe, u.creationDate as [User Creation Date],
u.Views,u.UpVotes,u.DownVotes,u.AccountID
FROM posts p
JOIN users u
ON p.OwnerUserId = u.Id
JOIN PostHistory ph
ON p.Id = ph.PostId
WHERE u.CreationDate >= '2016-01-01' and (PostTypeId = 1 or PostTypeId = 2)
) as a 
) as alias
WHERE RowNum BETWEEN 0 AND 50000

Enter Parameters

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