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
|
3438 Discussions
|
Please Login in order to post a comment
select (select max(salary*months) from employee)|| ' ' || (select count(employee_id) from employee where (salary*months = (select max(salary*months)from employee))) from dual
These are scalar subqueries that are just having fun
MS SQL SERVER
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)