Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

SELECT * FROM posthistory where userID = 88233 
and datepart(year,creationdate) in (2008,2009)
--datepart(year,creationdate) = 131971

select * from (
select datepart(year,ps.creationdate) Years, ps.userid,
    count(ps.userid) ActiveRevier from posthistory ps
    inner join posts p
    on ps.postid = p.id and ps.userid is not null
    where datepart(year,ps.creationdate) in (2008,2009)
    group by datepart(year,ps.creationdate), ps.userid
    having count(ps.userid) >= 5 
)a where a.userid = 88233

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results