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
|
3483 Discussions
|
Please Login in order to post a comment
SELECT (months * salary) AS earnings, COUNT(*) AS employee_count FROM employee GROUP BY (months * salary) ORDER BY earnings DESC LIMIT 1;
in MySQL SELECT CONCAT(total_earnings, ' ', employee_count) AS result FROM ( SELECT (Salary * Months) AS total_earnings, COUNT(*) AS employee_count FROM Employee GROUP BY Salary * Months ORDER BY total_earnings DESC LIMIT 1 ) t;