I've set up a Model in ArcGIS ModelBuilder (ArcMap 10.6) which select some rows of table "Rivers". Then i want to select the River with the Max-Value of Field "Diff" out of the selected Rows (not the whole Dataset). I tried to use "Select Layer by Attribute" with the following Expression
"Diff"= (Select MAX("Diff") FROM "Rivers")
it looks like the subquery selects "MAX" from the whole Dataset and not from my selection.
How do I extract the Max-Value from my selection?