Posts

Showing posts with the label Filter the (Maximum/Minimum) Salary for department whose count is 2 or more than 2

9 - Having Clause(To put condition on count)

Image
  ORIGINAL TABLE GENERATED Filter the Maximum Salary for department  whose count is 2 or more than 2 select * from employees where salary in ( select max (salary) from employees group by department having count (department)>= 2 ) ; Filter the Minimum Salary for department  whose count is 2 or more than 2 select * from employees where salary in ( select min (salary) from employees group by department having count (department)>= 2 ) ;