Hi All,
Please let me know whether this left outer join is correct? If correct will it effect the performance because I am using join with more than one columns.
both tables are in database so can I use the SQL join or data stage join. left table contain millions of records.
SELECT a.contractno, b.prism id
FROM Contract
LEFT OUTER JOIN prism
ON a.prism_cont_num = b.prism_cont_num
AND table1.product_cd = b.product_cd
and a.tie_breaker=b.tie_breaker
and a.contract_type=b.contract_type
Left Outer Join More than One column?
Moderators: chulett, rschirm, roy
How can we say if it is 'correct' or not? Check the explain plan. Run it. Check the results. Then you'll know if it is correct or not.
A join is still a join no matter if it is left, right, inner or outer, regardless of the number of columns you are joining and it will may need indexes on the join columns to perform well. You'll get all contracts with or without matching prism data... as long as you fix your aliases.
A join is still a join no matter if it is left, right, inner or outer, regardless of the number of columns you are joining and it will may need indexes on the join columns to perform well. You'll get all contracts with or without matching prism data... as long as you fix your aliases.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Left Outer Join More than One column?
you would need to define which tables are using the aliases "a", "b", "table1"