1

In ArcMap 10.5, I want to select the rows where the modulus of the objectid by 3 equals 1.

How to write a SQL sentence in select by attribute window?

My current query statement is something like this:

MOD( [OBJECTID],3)=1

but unfortunately it selects all of the rows. What's the problem with that?

Vince
  • 20,017
  • 15
  • 45
  • 64
user100316
  • 97
  • 1
  • 4
  • 2
    Which GIS software and version are you using? For something like this, you may need to use the modulus operator: "id" %3 = 1 – Joseph Aug 11 '17 at 10:19
  • 1
    Please [edit] the question to specify the GIS software in use, the format of the base data, and it's a database table, the RDBMS in which that table resides. – Vince Aug 11 '17 at 11:34
  • You still haven't specified the format of the data source. – Vince Aug 13 '17 at 15:31

1 Answers1

5

The following query works:

MOD("column_name", 3) = 1

where column values are of type integer belonging to a shapefile TOC.

Take a look at these related questions:

If you are querying a table from SQL Server using ArcGIS, then, the mod expression won't work. Use the modulo operator (%), instead. See:

Andre Silva
  • 10,259
  • 12
  • 54
  • 106