filtergisqgis

Exclude country usually preceded by a word


I would like the filter:

"name" like '%County%

to exclude fields with the word County (usually preceded by a word or two).

It currently does the opposite.


Solution

  • To exclude all fields that contain the word "County", you should use the NOT LIKE operator instead of LIKE.

    Any words before and after:

    SELECT * FROM your_table_name WHERE name NOT LIKE '%County%';
    

    Words before only:

    SELECT * FROM your_table_name WHERE name NOT LIKE '%County';