new

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 p.Id,count(vp.PostId) as upvote
from Posts p 
left outer join 
(select pp.ParentId,max(pp.CreationDate) as maxcdate
from Posts pp
where pp.PostTypeId=2 
group by pp.ParentId)pa on p.Id=pa.ParentId
left outer join 
(select v.PostId,v.CreationDate 
from Votes v
where v.VoteTypeId=3)vp on p.Id=vp.PostId
where p.PostTypeId=1
and p.Id%500=358
and Year(p.CreationDate)=2019
and vp.CreationDate<maxcdate
group by p.Id

Enter Parameters

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