I have a query like this:
SELECT state AS ls,count(*) AS total, max(sales) AS ye FROM TABLE
GROUP BY state
Then I get the following result:
A total ye
----------
a 22 23
b 23 23
c 24 21
d 25 21
But I want to display only state having maximum value of ye, i.e:
A total ye
----------
a 22 23
b 23 23
1 Answer