Hi,
I have SQL outer join query which is written in old format with (+) notation and I am working on its migration to the new presentation and without the (+) notation. I am unable to convert the last line of the query with the outer join condition.
Query in Old style:
SELECT cpd.customer_ref,
cpd.product_seq,
bci.contract_inst_id,
bci.start_dat bci_start_dat,
bci.end_dat bci_end_dat
FROM custproductdetails cpd, balcontractinstance bci
WHERE cpd.customer_ref = bci.customer_ref(+)
AND cpd.contract_seq = bci.contract_seq(+)
AND cpd.end_dat >= bci.start_dat(+) AND cpd.end_dat <= bci.end_dat(+);
I need to write the above query without the (+) notation.
Thanks
Sunil
To convert from Oracle syntax to ANSI, move all the join criteria into the join clause:
FROM custproductdetails cpd
LEFT JOIN balcontractinstance bci
ON cpd.customer_ref = bci.customer_ref
AND cpd.contract_seq = bci.contract_seq
AND cpd.end_dat >= bci.start_dat AND cpd.end_dat <= bci.end_dat
WHERE ...;