Hi I need a small help regarding writing a simple query. I want to display results based on max number of employees in a dept.
Here is my table
empid dept sal
emp001 d001 10000
emp002 d001 10000
emp003 d002 20000
emp004 d001 10000
emp005 d003 5000
emp006 d003 5000
Expected result
empid dept sal
emp001 d001 10000
emp002 d001 10000
emp004 d001 10000
emp005 d003 5000
emp006 d003 5000
emp003 d002 20000
so dept1 contains 3 employees so it should come first and dept3 contains 2 employees so it will come next and so on
Thanks in advance,
Nagu