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

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -