so i am looking to replicate the "find unmatched query wizard" from microsoft access in python.basically i have 2 tables and i want to output all the records from the one table that do not match the records of the other table based on a common ID.in theory it seems simple enough but i can't figure out how to do it.any help would be greatly appreciated!thanks,max
# select no-matches arcpy.AddJoin(tableview1,field1,table2,field2) # "KEEP_ALL" is the default prefix = arcpy.Describe(table2).Name strExpr = "%s.%s IS NULL" % (prefix,field2) arcpy.SelectLayerByAttribute(table1,strExpr) arcpy.RemoveJoin(tableview1,prefix) # select matches arcpy.AddJoin(tableview1,field1,table2,field2,"KEEP_COMMON") prefix = arcpy.Describe(table2).Name arcpy.SelectLayerByAttribute(table1,"0 <> 1") # select all arcpy.RemoveJoin(tableview1,prefix)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.