2

I know this is a very basic question, but I've been looking for an answer and haven't been able to find one, so here it goes. I am trying to build a long query to select features that have different values in the same field, in order to make it as agile as poossible. All in one selection.

Example: In a given attribute table, in the field "H1" select features that have values "31p", "34n", "61f" and "31q" in it.

"H1"  =  '31p'  OR  '34n'  OR  '61f'  OR  '31q' 
"H1"  =  '31p'  OR  "H1"  =  '34n'  OR  "H1"  =  '61f'  OR  = '31q' 

None of them work. Should I use "IS" logical operator instead of "="?

8

You should repeat the column name for each value in the query

"H1" = '31p' or "H1" = '34n' ...

You had better to use "in" operator like

"H1" in ('31p', '34n', '31q', '61f')
  • The first way you suggested doesn't work (I had already tried). But I was able to do it with the "in" operator. Thanks – dmasana Jan 24 at 13:17
  • I put here the whole expression: "H1" = '31p' OR "H1" = '34n' OR "H1" = '61f' OR "H1" = '31q' it will work. – Zoltan Jan 24 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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