1

I'm looking to exclude any streams that have values of "NULL" or "NP" using an SQL query in ArcGIS 10.2.

I've tried expressions like:

WTR_NM NOT (NULL, NP)

WTR_MN is the Field Name and I'm trying to remove the unnamed streams.

2
  • 1
    What product are you using? There are several that refer to themselves as 'Query Builder' (Oracle, Microsoft, etc). In that context what is NP? – Andrew - OpenGeoCode Oct 15 '14 at 20:50
  • This is in ArcMap 10.2 – Dameron Oct 17 '14 at 21:06
3

The SQL syntax for excluding nulls is slightly different from what is used to exclude normal values. The following should work to my knowledge:

WTR_NM IS NOT NULL AND WTR_NM <> 'NP'

This of course assumes that the NULL values are actually nulls, and not string values simply holding the word "NULL". It's counter-intuitive but the two types are different.

1
  • @Dameron As an aside, sometimes data can be pretty dirty when it comes to nulls. I frequently see cases where some values are truly <null> while others are simply blank (''). It's a good idea to verify this in your data, otherwise you might want to add a third condition to check for blanks as well - WTR_NM IS NOT NULL AND (WTR_NM <> 'NP' OR WTR_NM <> ''. Alternatively, WTR_NM IS NOT NULL AND WTR_NM NOT IN ('NP', ''). – Chris W Dec 15 '14 at 21:44

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.