LEFT OUTER JOIN ERROR

Database
Enthusiast

LEFT OUTER JOIN ERROR

Hello,

I am triying to make this request work :

SELECT

*

FROM

user11__employee emp

LEFT OUTER JOIN user11__customer cust

LEFT OUTER JOIN user11__department dept

ON emp.employee_number = cust.sales_employee_number

ON emp.department_number = dept.department_number

But i am getting the error 3782 telling me that "Improper column reference in the search condition of a join table"

Please I want to make this request work like this, any help will be wonderful !! :)

Regards,

Ghalia

2 REPLIES
Junior Contributor

Re: LEFT OUTER JOIN ERROR

Hi Galia,

this syntax-variation (JOIN-(JOIN-(JOIN-ON)-ON)-ON) is hardly used, because the first table is joined in the last ON.

Better switch to ((JOIN-ON)-JOIN-ON):

SELECT
*
FROM
user11__employee emp
LEFT OUTER JOIN user11__customer cust
ON emp.employee_number = cust.sales_employee_number
LEFT OUTER JOIN user11__department dept
ON emp.department_number = dept.department_number
Enthusiast

Re: LEFT OUTER JOIN ERROR

Hi Dieter,

I am just still curious to know if there is any impact on the performance by using one of them ? In term of performance which one is the best ?  I took the one i posted from a sample of questions that prepare for the teradata certification, and i didn't understand why they use the request i posted ? Any idea please ?

Many thanks for your answer !!

Ghalia