sql - Give a list of all employees, fname, lname and dept, who make more than the average in their building -


but only if they work in the creation of 400, 402 or 405

  Fname, lname, employees recruited, where building = 400 and building = 402 and building = 405;   

So if I get the AGG, then I have to figure out which numbers in SQL or what, can I use the AVG () function to find the answer? I think to use the subquery, but do not know how, help!

  select fname, lname, where employee (400,402,405) and salary & gt; (Where average salary from the employees' building (400, 402, 405));   

Whereas the "salary" employee makes the column is

Besides, your statement is wrong, I have edited for you.

Outside the subject question: Are you working in human resources and trying to find some officers who earn more to others, the company said to reduce the cost?

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -