If you want to use FGDB (apparently no supprt for MAX or MIN SQL statments = lame), here's a way to do it via Python using a reverse sorted dictionary:import arcgisscripting
gp = arcgisscripting.create(9.3)
fc = r"\\snarf\am\workspace\csny490\Buildings.gdb\BldgsToCompare"
parcelDict = {}
oidFieldName = gp.describe(fc).oidfieldname
searchRows = gp.searchcursor(fc)
searchRow = searchRows.next()
while searchRow:
taxLotValue = searchRow.MAPLOTUNIT
buildingAreaValue = searchRow.BLDG_AREA
oidValue = searchRow.getvalue(oidFieldName)
if taxLotValue in parcelDict:
parcelDict[taxLotValue].append([buildingAreaValue,oidValue])
else:
parcelDict[taxLotValue] = [[buildingAreaValue,oidValue]]
searchRow = searchRows.next()
del searchRow, searchRows
sqlString = ""
for parcel in parcelDict:
parcelDict[parcel].sort(reverse=True)
sqlString = sqlString + str(parcelDict[parcel][0][1]) + ","
gp.MakeFeatureLayer_management(fc, "fl", oidFieldName + " in (" + sqlString[:-1] + ")", "", "")