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
|
3479 Discussions
|
Please Login in order to post a comment
SELECT MAX(salary * months), COUNT(*) FROM Employee WHERE salary * months = (SELECT MAX(salary * months) FROM Employee);
For MySQL Platform
For MS SQL Server:
SELECT TOP 1 (Salary * Months) as EARNINGS, COUNT(name) FROM Employee GROUP BY Salary, Months ORDER BY EARNINGS DESC