posted 11 years ago
Now I want to write a query that gives me the highest paid male employee in each department.
I get What I was looking for
EID ENAME DID GENDER SALARY
222 Mohammad latif 1 M 15000
888 Ahmed Rehman 2 M 19000
But I want to display dept_name of employee rather than employees department id.
So I wrote this one
This gives me
EID ENAME DEPT_NAME GENDER SALARY
222 Mohammad latif CS M 15000
888 Ahmed Rehman IT M 19000
Above Query Have two joins , So i don`t think its efficient way.So i write this query.
So how one should go about writing a query that is efficient.
Tea Addict, Oracle Java Programmer , Oracle SQL Expert , Oracle Java Web Component Developer, Oracle Web Service Developer