Most Views

0

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 
PostId, count(posthistory.Id) as 'before' 
from posthistory
inner join posts on posts.id = posthistory.postid
where posthistory.creationdate<= posts.CommunityOwnedDate
and posthistorytypeid in (1,4,5,6,7,8,9)
and 
postId in (select PostId from posthistory
inner join posts on posts.id = posthistory.postid
where posthistorytypeid = 16 and posts.posttypeid=1)
group by Postid

Enter Parameters

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