SELECT ROW_NUMBER() OVER (ORDER BY p.Score DESC) AS 'ID'...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Psychology and Neuroscience

Q&A for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

SELECT 

    ROW_NUMBER() OVER (ORDER BY p.Score DESC) AS 'ID',
    p.Title, 
    p.Id, 
    p.AnswerCount,
    p.Score, 
    p.ViewCount, 
    u.DisplayName, 
    a.Id,
    au.DisplayName,
    a.Score,
    a.CreationDate,
    p.Tags
    
FROM Posts p
JOIN Users u ON p.OwnerUserId = u.Id
INNER JOIN PostTags pt ON p.Id=pt.PostId
INNER JOIN Tags t ON t.id = pt.TagId
JOIN Posts a ON p.Id = a.ParentId
JOIN Users au ON a.OwnerUserId = au.Id

WHERE t.TagName=##tagName:string?vba##
AND YEAR(p.CreationDate) >= 2008
AND YEAR(p.CreationDate) <= 2012
--And p.PostTypeId = 1
--And p.Score <=10
--And p.Score >=0
--And p.AcceptedAnswerId is null

ORDER BY p.Score DESC, a.Score DESC, a.CreationDate DESC

Enter Parameters

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