2

In the attribute table I have a column with many cities and want to select rows that only contain these city names, like "Paris" and "London". I tried: "cityname" ILIKE 'Paris' OR 'London' but it doesn't seem to work.

I have seen a reply using "arrays" to a similar question but I am not sure how it works and I would prefer to use ilike if possible.

Selecting more features with the "ilike" and "in" operator using QGIS

3
  • 6
    Have you tried "cityname" in ('Paris', 'London')?
    – ahmadhanb
    Commented Aug 24, 2020 at 8:29
  • 4
    Or "cityname" ILIKE 'Paris' OR "cityname" ILIKE 'London'?
    – user30184
    Commented Aug 24, 2020 at 8:31
  • 2
    Or "cityname" LIKE 'Paris' OR "cityname" LIKE 'London'?
    – Taras
    Commented Aug 24, 2020 at 8:45

1 Answer 1

4

You have to write the name of the field and the ILIKE again after the OR.

"cityname" ILIKE 'Paris' OR "cityname" ILIKE 'London'
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.