06-10-11, 08:49 #1Registered User
- Join Date
- Jun 2011
Unanswered: Code with 3 LEFT OUTER JOINS will not work, problem with GROUP BY/HAVING clause.
After such great help in my last post I thought I had definately got my head around why the code kept failing.
However another part of the problem yields another set of error messages from SQL Developer
So, again if anyone can shed any light on this situation I would be eternally grateful.
CREATE OR REPLACE VIEW TOP_EARNER_PER_LOCATION AS SELECT E.FIRST_NAME || ' ' || E.LAST_NAME AS EMPLOYEE_NAME, L.REGIONAL_GROUP AS REGIONAL_GROUP, E.SALARY AS SALARY, J.JOB_ID FROM EMPLOYEE E LEFT OUTER JOIN DEPARTMENT D ON D.DEPARTMENT_ID = E.DEPARTMENT_ID LEFT OUTER JOIN LOCATION L ON L.LOCATION_ID = D.LOCATION_ID LEFT OUTER JOIN JOB J ON J.JOB_ID = E.JOB_ID GROUP BY E.FIRST_NAME || ' ' || E.LAST_NAME HAVING J.JOB_ID NOT IN (670,671,672) ; REM #...SELECT STATEMENT TO RUN QUERY GOES HERE