We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Aggregation
- Top Earners
- Discussions
Top Earners
Top Earners
Sort by
recency
|
3258 Discussions
|
Please Login in order to post a comment
SELECT MAX(MONTHS * SALARY) AS TOTAL, COUNT(NAME) AS COUNT FROM Employee where MONTHS * SALARY = (SELECT MAX(MONTHS * SALARY) FROM employee)
(SIMPLE WAY)
select salary*months as total_earnings,count(*) from Employee group by total_earnings order by total_earnings desc limit 1;
SELECT (salary*months) as earnings,count(*) FROM Employee group by earnings order by 1 desc limit 1;
For MySQL