Tuesday, 12 September 2017

subquery in select by attribute in Arcgis


I have a table with several fields. field A contains the same kind of values as does field B. I tried to select all points where the value in field A does not exist in anywhere field B using query builder in select by attribute.


For example


ID A  B
1 a b
2 b c
3 c a

4 d b

It should select the points with ID 4 since value d does not exist in field B. I think I should use a subquery, but how?



Answer



If you use "IN" you can use a sub query that produces a list of all B values.Try:


NOT A IN (SELECT B FROM TABLE_NAME)

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...