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
|
3435 Discussions
|
Please Login in order to post a comment
SELECT sal, cnt FROM ( SELECT MAX(salary * months) sal, COUNT(employee_id) cnt from Employee Group By salary * months Order By salary * months Desc )d WHERE ROWNUM = 1;
select max(salary*months), count(employee_id) from employee where salary*months in (select max(salary*months) from employee)
WITH EARNING AS (SELECT *, (MONTHS*SALARY) AS 'TOTAL_EARNING' FROM EMPLOYEE) SELECT TOP 1 TOTAL_EARNING, COUNT(*) FROM EARNING GROUP BY TOTAL_EARNING ORDER BY 1 DESC