You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
459 B
MySQL
10 lines
459 B
MySQL
5 years ago
|
/*Write a query in SQL to display the first and last name, salary, and department ID for those employees whose salary is equal
|
||
|
to the salary of the employee who works in that department which ID is 40.
|
||
|
*/
|
||
|
|
||
|
SELECT first_name, last_name, salary, department_id
|
||
|
FROM employees
|
||
|
WHERE salary IN (
|
||
|
SELECT salary
|
||
|
FROM employees
|
||
|
WHERE department_id = 40);
|