Testing

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drones and Model Aircraft Meta

Q&A for experienced flyers, pilots, and builders of drones and model aircraft

DECLARE @TOTAL INT = 1156490
DECLARE @YEAR INT = 2014

select year(questions.CreationDate) Years,t.tagName TagName, count(questions.id) NumQuestions,
(count(questions.id)/cast(@TOTAL as float))*100 as percentage,
cast(round((count(questions.id)/cast(@TOTAL as float)*100 ),2) as NUMERIC(15,2)) percentageRound,
cast(count(questions.id) as varchar(20))+ CHAR(13) + CHAR(10) +'(' 
+cast( cast(round((count(questions.id)/cast(@TOTAL as float)*100 ),2) as NUMERIC(15,2))   as varchar(20))+
'%)' StringPercentatge

from PostTags pt
inner join posts questions 
on  pt.postid = questions.id and questions.posttypeid = 1  
and year(questions.CreationDate) = @YEAR and questions.AcceptedAnswerId is not null
inner join tags t
ON t.Id=pt.TagId and t.tagName in (select top 20 TagName from tags order by count desc)
group by year(questions.CreationDate),t.tagName

Enter Parameters

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