Select to view content in your preferred language

FGDB SQL — Multiple columns on the left-hand side of the IN operator

247
0
01-17-2024 11:08 AM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

ArcGIS Pro 3.2.1; file geodatabase

In a mobile geodatabase (and Oracle and Postgres), I can use a SQL expression in Select By Attributes like this:

(t_species, t_date) IN (
  SELECT 
    t_species, 
    max(t_date) 
  FROM 
    species_records 
  GROUP BY 
    t_species
)

Bud_0-1705518319206.png

That's a simple and efficient way to select the greatest 1 per group (with ties).

That technique can be described as: "using a row value (multiple columns) on the left-hand side of the IN operator".

Could FGDB SQL be enhanced to support that syntax?

Related: https://community.esri.com/t5/geodatabase-questions/select-maximum-values-in-select-by-attributes/m-... 

Tags (1)