Touchpoint Tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

Moderators

Q&A for community managers, administrators, and moderators

-- 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 ('nosql', 'couchdb', 'elasticsearch', 'redis', 'mongodb', 'cassandra', 'neo4J', 'advertisement', 'advertising', 'ads', 'AdMob ', 'hadoop', 'hbase', 'hdfs', 'mapreduce', 'hive', 'gae-datastore', 'machine-learning', 'hierarchical-clustering', 'cluster-analysis', 'solr', 'lucene')
    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