programming-examples/sql/SubqueriesHRDatabase/Write a query to display the ( first name and last name ) and job title for all employees whose salary.sql
2019-11-18 14:05:53 +01:00

11 lines
454 B
SQL

/*Write a query to display the employee number, name( first name and last name ) and job title for all employees whose salary
is more than any salary of those employees whose job title is PU_MAN. Exclude job title PU_MAN.
*/
SELECT employee_id, first_name, last_name, job_id
FROM employees
WHERE salary > ALL
( SELECT salary
FROM employees
WHERE job_id = 'PU_MAN' )
AND job_id <> 'PU_MAN' ;