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

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -