Testing

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS

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

select resultTable.Years, count(resultTable.OwnerUserId),(SELECT count(*) 
FROM users
where datepart(year,creationdate) = resultTable.Years) UserActivityInPercentage
from (
select datepart(year,creationdate) Years,OwnerUserId, count(*) 
NoOfQuestionPost
from Posts where OwnerUserId in 
(SELECT  Id  FROM users
where datepart(year,creationdate) = 2008)
and posttypeid = 1 and datepart(year,creationdate) < 2019
group by datepart(year,creationdate), OwnerUserId 
having count(*) > 5
--order by datepart(year,creationdate), OwnerUserId
) resultTable 
group by resultTable.Years




/*
select resultTable.Years, (count(resultTable.OwnerUserId)/(SELECT count(*) 
FROM users
where datepart(year,creationdate) = resultTable.Years))*100 UserActivityInPercentage
from (
select datepart(year,creationdate) Years,OwnerUserId, count(*) 
NoOfQuestionPost
from Posts where OwnerUserId in 
(SELECT  Id  FROM users
where datepart(year,creationdate) = 2008)
and posttypeid = 1 and datepart(year,creationdate) < 2019
group by datepart(year,creationdate), OwnerUserId 
having count(*) > 5
--order by datepart(year,creationdate), OwnerUserId
) resultTable 
group by resultTable.Years
*/


/*
select datepart(year,creationdate) Years, count(*) UsersOf2008_Activity
from Posts where OwnerUserId in 
(SELECT  Id  FROM users
where datepart(year,creationdate) = 2017)
and posttypeid = 2 and datepart(year,creationdate) between 2017 and 2018
group by datepart(year,creationdate) 
having count(*) >5
*/

Enter Parameters

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