You are viewing a single comment's thread. Return to all comments →
you don't use max then how your query able to output the max of the months*salary?
Thats why there is order by months x salary desc 1 segment that shows the only one row with max value
Then you should see this in mysql!! :)
select max(months*salary), count(*) from employee where salary*months = (select max(months*salary) from employee);
That's right too..every problem has number of solutions it just depends on how you approach it. :-) happy coding!!!
basically I write in this way coz I'm not good at group by and order by.. Can u plz help me on these two.!!