'Select Min Value by Group' SQL Query Not Working

314
0
03-27-2023 04:56 PM
Labels (3)
kawakawa4
New Contributor III

Using ArcGIS Pro 3.1, I have a point featureclass: SalinityPoints, which is in a File Geodatabase. Using the Select by Attributes tool, I want to group these values by the field Sal_Met_ID_Text (text field)then select the minimum value from the field Salinity_Bottom (double field)  in each group.

I have found what I thought was the correct SQL query for this in several places around the internet, but when I use it, I get only 3 rows selected (which are not the minimum salinity for each group), when there should be 62 rows selected as there are 62 unique values in the Sal_Met_ID_Text field:

Salinity_Bottom = (SELECT MIN ( Salinity_Bottom ) FROM SalinityPoints GROUP BY Sal_Met_ID_Text )

Any ideas where I am going wrong here please? .gdb attached.

Tags (2)
0 Kudos
0 Replies