AnsweredAssumed Answered

Using SQL to "Select by Attributes" comparing fields...

Question asked by MidnightYell2003 Champion on Jan 28, 2019
Latest reply on Jan 29, 2019 by MidnightYell2003

I'm trying to write a simple SQL query that just isn't working. I have two fields in my file geodatabase layer (ArcGIS Pro 2.3) and I want to select the records that match my simple SQL query of:

 

written out to LEFT(Layer,3) = OWNERSHIP_NUMBER

 

But I get an error saying that "The SQL expression has invalid syntax".

 

I must be doing it wrong somewhere but I don't know where. These are both FIELDS and not RECORDS, so that likely makes a difference in how my syntax is supposed to be written.

 

Looking up this article: SQL reference for query expressions used in ArcGIS—ArcGIS Pro | ArcGIS Desktop 

it says "

String functions can be used to format strings. For instance, the LEFT function would return a certain number of characters starting on the left of the string. In this example, the query would return all states starting with the letter A:

LEFT(STATE_NAME,1) = 'A'

"

 

So, it makes me think my syntax is mostly right since both of my fields are strings. Any advice on making my SQL query syntax work?

Outcomes