programming-examples/sql/SubqueriesHRDatabase/Write a query to display the employee number, name ob title for all employees whose salary is smaller than any.sql
2019-11-18 14:05:53 +01:00

12 lines
452 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
smaller than any salary of those employees whose job title is MK_MAN. Exclude Job title MK_MAN.
*/
SELECT employee_id,first_name,last_name, job_id
FROM employees
WHERE salary < ANY
( SELECT salary
FROM employees
WHERE job_id = 'MK_MAN' )
AND job_id <> 'MK_MAN' ;