SQL Selection: Minimum Value in Group.

04-20-2022 06:00 PM
Labels (3)
New Contributor III

Hopefully this is a simple one for someone that knows SQL.

I have a featureclass in a file gdb named Salinity_pnt.

Using the Select by Attribute tool, I need to select rows with minimum values of Salinity_Bottom, per Sal_Metadata_ID group (circled below):


I have read that because this data is in a file gdb, I will need to use a scalar subquery, but this will only return one row, and I need more than one rows returned.

Is there another way to complete this selection using SQL or should I be looking at another method? I'm trying to incorporate this into a ModelBuilder model.

I have tried the method of using the Summary Statistics tool, then joining the resulting table back to the Salinity_pnt featureclass using the Make Query Table tool, but the Make Query Table Tool does not work correctly in Modelbuilder. 

Many thanks.


Tags (1)
0 Kudos
0 Replies