Fourth

1

Please login or register to vote for this query.

(click on this box to dismiss)

Sitecore

Q&A for developers and end users of the Sitecore CMS and multichannel marketing software

with 
ids as (select p.owneruserid from posts p group by p.owneruserid having datediff(month, min(p.creationdate), getdate())>=11*12+5)
,
psts as (select p.creationdate, p.owneruserid, p.id from posts p where p.owneruserid in (select * from ids))

,
main as (select '1' as r
from psts p
left join psts p2 on p.owneruserid = p2.owneruserid
and abs(Datediff(year, p2.creationdate, p.creationdate))<1
where p.id != p2.id
group by p.owneruserid
having count(case when p2.id is null then 1 end) = 0)

select count(r) from main;

Enter Parameters

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