[GIS] How to select different values from two columns through Select By Attributes

arcgis-10.3arcgis-desktoparcmapfield-calculatorselect-by-attribute

I'm using ArcMap 10.3. I'm trying to select by attributes different values from two columns.

I want to define the areas where

  1. Main rock is GRAVEL And
  2. Sub-rocks are :

a. mudstone tephra loess

b- sand mud

c- …

d- …

e- sand mud peat

I have tried to do it as shown below

"MAIN_ROCK" = 'gravel'  AND "SUB_ROCKS" = 'sandstone siltstone mudstone limestone silt lignite' AND "SUB_ROCKS" = 'mudstone tephra loess'  AND "SUB_ROCKS"= 'sandstone mudstone tephra silt lignite' AND "SUB_ROCKS" = 'sand mud peat' AND "SUB_ROCKS" ='sand mud'

enter image description here

After I clicked on apply, nothing was highlighted.

Any idea how can I do this?

Best Answer

I think it is always better to include the text from your Select By Attributes dialog and error message rather than pictures to aid future searches by people who may encounter the same problem but from your picture it looks like changing:

"SUB_ROCKS" 'sand mud'

to:

"SUB_ROCKS" = 'sand mud'

should address this instance of the error message you see.

Your second issue of nothing being highlighted after correcting the above should be addressed by improved logic where the elegant suggestion of @FaridCher looks right to me:

"MAIN_ROCK"='gravel' AND "SUB_ROCKS" in ('mudstone tephra loess','sand mud','sand mud peat','sandstone mudstone tephra silt lignite','sandstone siltstone mudstone limestone silt lignite') 
Related Question