Select TagName, AVG(UpVoteCount) as AvgUpVote -- From ( S...

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

Select TagName, AVG(UpVoteCount) as AvgUpVote --
From ( 
Select Posts.ID
       ,Tags.TagName
       ,cast(Count(1) as Decimal(10,4)) as UpVoteCount --Decimal(10 cipari kopā, 4 aiz komata?)
From Posts
Inner Join Users on Users.ID=Posts.OwnerUserId AND UPPER(Users.Location) like '%Latvi%'
Inner Join PostTags on PostTags.PostID=Posts.Id
Inner Join Tags     on PostTags.TagID=Tags.ID
            AND (UPPER(Tags.TagName)='SQL'
            OR  UPPER(Tags.TagName)='MYSQL')
INNER Join  Votes ON Votes.PostID=Posts.ID
Inner Join  VoteTypes ON Votes.VoteTypeId=VoteTypes.Id
                      AND VoteTypes.Name='UpMod'
Group by Tags.TagName,Posts.ID
)
AS PostSubQr
Group BY Tagname

;

Enter Parameters

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