I have a shapefile where I have polylines and their fields are:
- area into which they fall in
Now I need 3 longest lines from each area. I have 3 areas and 50 polylines, so I should get 3*3=9 records as a result. What I try to do is:
myFile = somePath
sql = ('TOP 3', 'ORDER BY "length" DESC GROUP BY "area_id" ')
cursor = arcpy.da.SearchCursor(myFile , "*", None, None, False, sql)
for r in cursor:
I get all of 50 records here. The same happens when I set `sql` to just `('TOP 1', None) or anything else.
Is the syntax wrong here?