9 - Having Clause(To put condition on count)

 

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) ;


Comments

Popular posts from this blog

5 - DML commands used in MySQL WorkBench

INDEX OF Zeek MySQL

4 - DDL commands used in MySQL Workbench