4

I would like to get the user IDs, user names, the number of posts, and the total score for a certain tag for each user in a specific country (sorted in descending order by score).

For example, in the search query I would enter "Lebanon" for country and "iOS" for the tag, and the result would be something like this (the first entry is real, my own!):

userID userName NumPosts score
766570 abbood 171 860
63343 mike1515 200 700
532342 superman 50 600

This should match with what appears on the user's profile, for example, for the first user:

Tags section

Help/References

  • I tried something like this, but it is very simplistic
  • This query basically gets the number of posts per user
5

1 Answer 1

6
+50

This query does the job. The tricky thing is that only answers count for the score, and Community Wiki posts are excluded. Also, the query assumes everybody uses the same spelling for the location. Some users put a fake location, or maybe just the town or region, or an abbreviation of the country.

enter image description here

I've added the Location column, because as @Martin noted in the comments, toponyms are often reused (especially in the USA, by all those expatriates). If you scroll further down, you'll see 'Lebanon, TN, USA' and 'Lebanon, IL, USA'.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .