12

I was looking at a website, the author had placed his Stack Exchange link in his website. It catch my eyes and I followed the link. in the Stack Exchange website it was written that he is one of the top five users in Turkey.

I'm wondering how can I find top users in my country (or any country).

1

2 Answers 2

13

You can do it using Data SE. Have a look at this query. You can add number of top users, Full country name, and Short country name in the query.

SELECT
    Top ##Top##
    ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [#], 
    Id AS [User Link], 
    Reputation
FROM
    Users
WHERE
     LOWER(Location) LIKE LOWER('%##FullCountryName##%')
  OR UPPER(Location) LIKE UPPER('%##ShortCountryName##%')
ORDER BY
    Reputation DESC;
6
  • 1
    Note: This causes problems with ISO-3166 alpha-2 codes for countries that match US state names, as well as countries like Georgia which become difficult to distinguish. Some of the biggies: CA for Canada/California, MA for Massachusetts/Morocco, IL for Illinois/Israel. There is a bunch of info on users by country here
    – jmac
    Nov 18, 2013 at 7:28
  • @jmac - Good point. Then better to search just by full name. :)
    – Himanshu
    Nov 18, 2013 at 7:30
  • in an ideal world, you'd analyze not just whether the short string exists, but whether it exists alone. If someone says, "Los Angeles, CA" vs. "Toronto, Ontario, CA" you can easily tell which is which. Writing a script to do that, however... It would be so much nicer if the location section of profiles was more than just a text field, but with it as it is, there isn't any real way to get accurate data unless you are willing to manually go through the data. Run a broad search, then sift it by hand.
    – jmac
    Nov 18, 2013 at 7:34
  • Is possible to order by year-reputation? Jul 31, 2019 at 2:03
  • @Mir-Ismaili: I don't think we can find from the available tables.
    – Himanshu
    Jul 31, 2019 at 9:16
  • @hims056; OK. Thank you. Aug 1, 2019 at 3:21
2

Go here:

SELECT
    ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [#], 
    Id AS [User Link], 
    Reputation
FROM
    Users
WHERE
    LOWER(Location) LIKE '%singapore%'    --Change the name of the country here.
    OR UPPER(Location) LIKE '%SG'
ORDER BY
    Reputation DESC;

Change the name of the country to the name for which you want to find out the top users.

You must log in to answer this question.

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