posted 10 years ago
I have to write a query that will list all the employees in each department whose salary is less than highest salary of that department.
It works correctly and give me what I was looking for
ID NAME DEPT_ID SALARY
222 CS Professor 1 40000
333 CS Lecturer 1 30000
555 IT Guest 2 30000
666 IT Reader 2 44000
888 EE Lecturer 3 33000
But when I try Group By it does not give me what I was looking for
This is the result I get
ID NAME DEPT_ID SALARY
111 CS HOD 1 50000
222 CS Professor 1 40000
333 CS Lecturer 1 30000
444 IT HOD 2 55000
555 IT Guest 2 30000
666 IT Reader 2 44000
888 EE Lecturer 3 33000
Tea Addict, Oracle Java Programmer , Oracle SQL Expert , Oracle Java Web Component Developer, Oracle Web Service Developer