select Posts.Id, Posts.Score into #newquestions from Post...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Super User

Q&A for computer enthusiasts and power users

select Posts.Id, Posts.Score 
into #newquestions
from Posts 
inner join Users on Posts.OwnerUserId = Users.Id
where 
 PostTypeId = 1 and
 Reputation < ##RepCutoff## and
 ABS(DATEDIFF(d, Posts.CreationDate, GETDATE())) < ##MaxAgeInDays##

select 
 (select count(*) from #newquestions where Score < 0) as Negative,
 (select count(*) from #newquestions where Score = 0) as Neutral,
 (select count(*) from #newquestions where Score > 0) as Positive

Enter Parameters

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