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
|
3519 Discussions
|
Please Login in order to post a comment
select months*salary AS earnings, count(employee_id) from Employee group by earnings order by earnings desc limit 1;
SELECT max(months*salary), count(*) from Employee where (months*salary) = (SELECT max(months*salary) from Employee) ;
SELECT months * salary AS earnings, COUNT(*) AS employee_count FROM employee GROUP BY earnings HAVING earnings = ( SELECT MAX(months * salary) FROM employee );
SELECT earning, count(earning) FROM
(SELECT employee_id, salary, months*salary as earning FROM Employee ORDER BY months*salary DESC) as ren
Group BY earning ASC ORDER BY count(earning) DESC LIMIT 1;