sql - Display salary, Avg(salary), Name for those who earns more than company Avg(salary) -
how display name, salary , avg(salary) employees salary greater company avg(salary).
i have tried following query:
select last_name, salary employees salary >(select avg(salary) employees);
this gives names of employees getting higher salary company avg(salary). want display avg(salary) in select list aswell.
join employee table query produces average:
select last_name, salary, avg_salary employees join (select avg(salary) avg_salary employees) x on salary > avg_salary
this query work on databases.
Comments
Post a Comment