test

0

Please login or register to vote for this query.

(click on this box to dismiss)

Gardening and Landscaping Meta

Q&A about the site for gardeners and landscapers

SELECT TOP 100
  (CASE p.PostTypeId
        WHEN 1 THEN 'Q'
        WHEN 2 THEN 'A'
    END),
  v.PostId AS [Post Link],
  p.OwnerUserId AS "User Link",
  v.CreationDate AS [Date],
  (DateDiff(second, Min(p.CreationDate), v.CreationDate) + 86400) / 86400 AS [Age],
  Count(*) AS [Upvotes]
FROM Votes v
LEFT JOIN Posts p ON p.Id = v.PostId
WHERE v.VoteTypeId = 2 and p.PostTypeId is not null
GROUP BY
    v.PostId,
    v.CreationDate,
    p.OwnerUserId,
    p.PostTypeId
ORDER BY [Upvotes] DESC

Enter Parameters

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