Resolved: Why a subquery?
Why in this query we use a subquery?
select a.emp_no,
max(salary) as max_salary from
(select emp_no, salary
from salaries) a group by emp_no;
Is this for the learning purpose?
Can we just use the following query with the same result?
select emp_no,
max(salary) as max_salary
from salaries group by emp_no;
1 answers ( 1 marked as helpful)
Hi Eugenia!
Thanks for reaching out.
Yes, you can use both queries. The idea is to practise subqueries.
Hope this helps.
Best,
Tsvetelin