Total Views for Tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Combined number of views for all question of a certain tag

Craft CMS Meta

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

-- Total Views for Tag
-- Combined number of views for all question of a certain tag

SELECT Sum(ViewCount) as TotalViews, Count(*) as NumberOfQuestions
FROM Posts p
JOIN PostTags pt ON pt.PostId = p.Id
JOIN Tags t ON t.Id = pt.TagId
WHERE t.TagName = ##Tag:string## AND p.PostTypeId = 2

Enter Parameters

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