Test: Location Somewhere

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

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

              (
               lower(Location) LIKE '%ukraine%' 
               -- http://sustainablesources.com/resources/country-abbreviations/
               OR Location LIKE '%UA' 
              
               OR lower(Location) LIKE '%alchevsk%'
               OR lower(Location) LIKE '%brovary%'
               OR lower(Location) LIKE '%cherkassy%'
               OR lower(Location) LIKE '%cherkasy%'
               OR lower(Location) LIKE '%chernihiv%'
               OR lower(Location) LIKE '%chernivtsi%'
               OR lower(Location) LIKE '%chernivtsy%'
               OR lower(Location) LIKE '%crimea%'
               OR lower(Location) LIKE '%dnepropetrovsk%'
               OR lower(Location) LIKE '%dnipropetrovsk%'
               OR lower(Location) LIKE '%dnipropetrovs''k%'
               OR lower(Location) LIKE '%donetsk%'
               OR lower(Location) LIKE '%donets''k%'
               OR lower(Location) LIKE '%feodosiya%'
               OR lower(Location) LIKE '%gulyaypole%'
               
               )
    
          -- exclusions
             and not(
                 
               
                lower(Location) LIKE '%donetsk, russia%'  
                 
                 --testing
               --OR lower(Location) = 'ukraine'
               OR lower(Location) LIKE '%alchevsk%'
               OR lower(Location) LIKE '%brovary%'
               OR lower(Location) LIKE '%cherkassy%'
               OR lower(Location) LIKE '%cherkasy%'
               OR lower(Location) LIKE '%chernihiv%'
               OR lower(Location) LIKE '%chernivtsi%'
               OR lower(Location) LIKE '%chernivtsy%'
               OR lower(Location) LIKE '%crimea%'
               OR lower(Location) LIKE '%dnepropetrovsk%'
               OR lower(Location) LIKE '%dnipropetrovsk%'
               OR lower(Location) LIKE '%dnipropetrovs''k%'
               OR lower(Location) LIKE '%donetsk%'
               OR lower(Location) LIKE '%donets''k%'
               OR lower(Location) LIKE '%feodosiya%'
               OR lower(Location) LIKE '%gulyaypole%'
               
               
               
                     )   
                  
   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 sites:
loading Hold tight while we fetch your results