1

I want to select records by comparing two similar text field in ArcGIS Desktop 10.3 (data stored in an ORACLE ArcSDE database).

I'm looking to select all records where field1 contain a string that is a part of the string in field2 (both fiels on the same table).

(field1 is the name and field2 the location, usually I have a name like "School" and a location like "Example street" but sometime the name is "House on this street" and the location is "this street", my goal is to filter these)

I know how to compare a field with part of a string :

field1 LIKE '%string%'

But I can't get it to work with two field, I tried lots of variation of

field1 LIKE '%field2%'

or

field1 LIKE '%' & field2 & '%'

But it never work, I get error messages like invalid character or missing closing parenthesis.

So is it possible to compare two field with the LIKE operator and how ?

closed as off-topic by user30184, Vince, aldo_tapia, pLumo, whyzar Feb 7 '18 at 16:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions relating to general IT or with no clear GIS component, are off-topic here but can be researched/asked at Stack Overflow (software development), Super User (computing hardware and software), Database Administrators (relational databases) and other SE sites" – user30184, Vince, aldo_tapia, pLumo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • you need a JOIN – pLumo Feb 7 '18 at 15:37
  • This is a pure SQL question, without a GIS focus. Once you have the SQL right, you can edit this question if you have trouble using it from ArcMap. You should certainly specify which exact RDBMS is in use, since each has different string manipulation tools available (with very different syntax). – Vince Feb 7 '18 at 15:40
1

The double pipe symbol is Concatenation and works when I query a file geodatabase.
field1 like '%' || field2 || '%'

  • That work perfectly, I just have to add an UPPER to made the selection case insensitive – J.R Feb 7 '18 at 16:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.