SHARE
TWEET

Untitled

a guest Sep 20th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT DISTINCT EMPLOYEE.NAME, EMPLOYEE.POSITION FROM EMPLOYEE WHERE EMPLOYEE.DEPARTMENT_ID=[Введите интересующий отдел];
  2.  
  3. SELECT EMPLOYEE.NAME FROM EMPLOYEE
  4. JOIN (SELECT CHIEF_ID, AVG(SALARY) AS S FROM EMPLOYEE WHERE CHIEF_ID IS NOT NULL
  5. GROUP BY CHIEF_ID) AS T ON EMPLOYEE.ID = T.CHIEF_ID
  6. WHERE EMPLOYEE.SALARY > (T.S * 2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top