User List: Top N - Cambodia

1

Please login or register to vote for this query.

(click on this box to dismiss)

elementary OS Meta

Q&A about the site for developers and users of elementary OS and applications

-- List of Users in Cambodia
SELECT
    Top ##Top##
    
    ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [# by Rep], 
    Id AS [User Link], 
    Reputation,
    Location,
    --CreationDate,
    LastAccessDate,
    UpVotes,
    DownVotes
    
FROM
    Users

WHERE
     (
      lower(Location) LIKE lower('%Cambodia%')
      -- http://sustainablesources.com/resources/country-abbreviations/
      
      or UPPER(RIGHT(RTRIM(Location), 3)) = ' KH'
      or UPPER(RIGHT(RTRIM(Location), 3)) = ',KH'
      or UPPER(Location) = 'KH'
      
      or lower(Location) LIKE lower('%Kampot%')
      or lower(Location) LIKE lower('%Phnom Penh%')
      
      )
      
       -- exclusions
       and not
       (
         lower(Location) LIKE lower('%dummy%')
       --for testing
       --or lower(Location) = lower('Cambodia')
       --or lower(Location) like lower('%, Cambodia')
       )   
                  
   and LEN(Location) > 1
   --and Reputation > 1

    --Temporarily sort by location to more easily pick out false positive entries
    --ORDER BY Location ASC;

Enter Parameters

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