select rows how to query in sql
问题 I have a use case like a 3 a 4 a 5 a 6 a 5 b 3 b 5 b 3 how to get the output like a 4 a 5 b 5 b 3 choose the hight number for a and b, but just 2 rows that's the query I wrote now, seems it is not working SELECT id, barcode, actualsku, inventorycount FROM ( SELECT pallet.id AS id, pallet.barcode AS barcode, inventoryunit.sku AS actualsku, Count(inventoryunit.id) AS inventorycount FROM (SELECT * FROM mft.asset WHERE container_type = 'PALLET' AND location_type = 'PRIME' :: mft.location_type AND