Tuesday, November 22, 2011

SQL in ArcGIS

Today, I was asked to map a subset of a publicly available dataset. Generally being a fan of SQL, I thought that this might be the quickest way to reduce the data to that which I needed.

However, ArcGIS SQL is not like the SQL we all know, which makes it simple to add a list to a "WHERE" statement:


SELECT * FROM table1 WHERE ppl IN ('James', 'Samuel', 'Jack');

In ArcGIS SQL it is necessary to have one statement per list item, even it all comes from the same column:


SELECT * FROM table1 WHERE "ppl" = 'James' OR "ppl" = 'Samuel' OR "ppl" = 'Jack'


I didn't see any obvious note of this in the ArcGIS documentation and is a curious deviation from normal SQL protocol.

No comments:

Post a Comment