Top FPGA related UK

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sitecore Meta

Q&A about the site for developers and end users of the Sitecore CMS and multichannel marketing software

-- Top users by tag and Users.location
-- Currently only looking at score for questions.  Not sure how to fix this yet.

--SELECT TOP 20 * FROM Posts


select Answers.OwnerUserId AS UserId, Tags.Id As TagId, Tags.TagName, SUM(Answers.Score) AS Score
     FROM Tags 
    JOIN PostTags ON Tags.Id = PostTags.TagId
    JOIN Posts ON Posts.Id = PostTags.PostId  
    JOIN Posts Answers ON Answers.ParentId = Posts.Id 
    JOIN Users ON Users.Id = Answers.OwnerUserId 
    WHERE Tags.TagName 
    IN ('fpga','vhdl','xilinx','verilog','hardware','raspberry-pi','hardware-interface','embedded','nios','pci-e')
    and Answers.OwnerUserId is not null and Answers.OwnerUserId <> ''
    and
(
  lower(Users.location) like '%united kingdom%' or
(lower(Users.location) like '%england%' 
and lower(Users.location) not like '%new england%'
) 
or
(lower(Users.location) like '%london%' 
and lower(Users.location) not like 'london%on' 
and lower(Users.location) not like '%ontario%'
and lower(Users.location) not like '%canada%'
)
or
(lower(Users.location) like '%uk%' 
and lower(Users.location) not in ('breukelen','takatsuki','phuket','fukushima','ukarine','ukrain','pewaukee','tutukaka','waukesha','pennsauken','fukuoka','fukui','shinjuku','ukraine','waukegan','iizuka','tukwilla','shinjuku','fukuoka','kentukcy','sukadana','tsukuba','london\,\ ky','luka','yokosuka','ortenaukreis','takarazuka','mukwonago','ukrane','sukabumi','milwaukee'))

or
lower(Users.location) like '%sussex%'
or
lower(Users.location) like '%bristol%')
  GROUP BY Answers.OwnerUserId, Tags.Id, Tags.TagName
  order by Score desc

Enter Parameters

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