I am trying to complete a select by attribute in Python but based on the query of whether an attribute is present in a list.
Such a query at its simplest should be something like this:
qry = " \"OBJECTID\" in oid_list"
arcpy.SelectLayersByAttribute_management(inft, "NEW_SELECTION", qry)
but that approach returns an invalid expression error.
In the past, I've had to use more complicated sytax for this type of query, such as:
sqlQuery2 = "nid in (" + ','.join(["'"+x+"'" for x in delta_list]) +")"
but an adaptation of this snippet doesn't seem to work for me either, ie.:
"OBJECTID_1 in (" + ','.join(["'"+str(x)+"'" for x in oid_list]) +")"
What am I missing here?