List the names of employees whose salary is greater than the average salary of the department in which the given employee works.
I have came out with the following solution: column names are: emp_id, name, dept, salary in the table named employee.
select name from employee
where salary >
(
select avg(salary) from employee
where dept= (select dept from employee where emp_id = 'a10')
)
and
dept = (select dept from employee where emp_id = 'a10')
;
Can i make this a little shorter query, expecting the same result?