Infos sobre tags jasminsoftware e primaverabss

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow em Português

Perguntas e respostas para programadores profissionais e entusiastas

SELECT 
	Tags.Tagname 							AS Tag, 
	Count(*) 								AS Questions, 
	Sum(Cast(Posts.ViewCount as bigint)) 	AS Views,	
	Sum(Posts.Score) 						AS Score,
	Sum(Posts.AnswerCount) 					AS Answers,
	SUM(CASE 
		WHEN PostHistory.PostHistoryTypeId = 10 then 1
		else 0
	end) 									AS QtdeFechada,
    SUM(CASE 
		WHEN Posts.AcceptedAnswerId IS NOT NULL then 1
		else 0
	end) 									AS QtdeRespondida
FROM Posts 
	INNER JOIN PostTags 	ON Posts.Id 			= PostTags.PostId
	LEFT JOIN PostHistory	ON PostHistory.id	= (select top 1 P.id from PostHistory P where p.PostId = Posts.Id order by CreationDate desc)
	INNER JOIN Tags 		ON PostTags.TagId 		= Tags.Id
WHERE 1=1
	and Posts.PostTypeId = 1
	and Tags.id in (6089, 6090)
GROUP BY 
	Tags.Tagname

Enter Parameters

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