I have a table with three columns: region, country, count. I want to reduce my table to rows of region, country and count - where count is maximal among the region.
For example, if I have the following table:
region | country | count
asia | jo | 12
asia | ir | 12
asia | il | 10
europe | fr | 8
europe | it | 2
I'd expect to get in return:
region | country | count
asia | jo | 12
asia | ir | 12
europe | fr | 8
You can achieve this in this way: First you need to group the data by the
regionfield and get the maximum value. Then execute a simpleINcondition with fieldsregionandcountDemo in sqldaddy.io