Skip to content

ALL

SELECT Employee_Name
FROM Employees
WHERE Salary > ALL (SELECT Salary
FROM Employees
WHERE Department_ID = 2);
+---------------+
| Employee_Name |
+---------------+
| John |
| Jane |
+---------------+

In the above example, the SQL statement is selecting all Employee_Name from the Employees table where the Salary is greater than all the salaries of employees present in Department_ID 2. As a result, we get the names of the employees who are earning more than every employee from Department_ID 2, which in this case, are John and Jane.