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
- Main rock is GRAVEL And
- 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'
After I clicked on apply, nothing was highlighted.
Any idea how can I do this?
1 Answer 1
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')
-
4I would mention here the in operator... SUB_ROCKS in ('sand mud peat','other') is the same as writing SUB_ROCKS = 'sand mud peat' OR SUB_ROCKS = 'other'.. it doesn't make a difference to your selection but the text is much shorter and easier to debug.Michael Stimson– Michael Stimson2015年09月11日 00:57:15 +00:00Commented Sep 11, 2015 at 0:57
-
1Michael suggestion is right. But In operator is for OR conditions and not AND.Farid Cheraghi– Farid Cheraghi2015年09月11日 00:59:13 +00:00Commented Sep 11, 2015 at 0:59
-
2building on top of Polygeo answer, you should use OR instead of AND for SUB-Rock conditions, because a subrock can not be all of the types you have included in your queryFarid Cheraghi– Farid Cheraghi2015年09月11日 01:00:19 +00:00Commented Sep 11, 2015 at 1:00
-
2SO the nice and proper query would be: "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')Farid Cheraghi– Farid Cheraghi2015年09月11日 01:02:35 +00:00Commented Sep 11, 2015 at 1:02
-
3there is typo change "MAIN_ROCK"='gravel" to "MAIN_ROCK"='gravel'Farid Cheraghi– Farid Cheraghi2015年09月11日 01:09:39 +00:00Commented Sep 11, 2015 at 1:09
Explore related questions
See similar questions with these tags.