Select to view content in your preferred language

How to select the largest value grouped by another field in ArcPro?

381
1
04-27-2023 10:06 AM
Labels (2)
hansgreg
New Contributor

I'm working with tree inventory data and am trying to select the largest individual tree per species type. This is my python code that I'm inputting into ArcPro:

DBH = (SELECT max( "DBH" ) FROM "TI_MASTER" GROUP BY "COMMON_NAME" )

Where DBH is my tree size field, TI_MASTER is the attribute table, and COMMON_NAME is the species type field. I keep getting invalid syntax errors. Any suggestions?

TIA!

0 Kudos
1 Reply
MicZatorsky_AEC
Occasional Contributor III

Do you need to use SQL?  If you can run a tool Summary Statistics will return a table:

  • the stats field set to tree size, max
  • the case field set to the common name
0 Kudos