SELECT * FROM PS
LEFT JOIN LW ON PS.C = LW.C AND PS.DEPTID = LW.DEPTID
LEFT JOIN DY ON PS.C = LW.C AND PS.DEPTID = DY.DEPTID
ORDER BY PS.C, PS.DEPTID, PS.D, PS.S
I don't think there's anything wrong with the query, maybe adding "access" parens would help?
SELECT * FROM (PS
LEFT JOIN LW ON PS.C = LW.C AND PS.DEPTID = LW.DEPTID)
LEFT JOIN DY ON PS.C = LW.C AND PS.DEPTID = DY.DEPTID
ORDER BY PS.C, PS.DEPTID, PS.D, PS.S
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.