At the risk of confusing misuk11 further, I prefer to write joins the other way round, in the way that my brain considers "forwards". My thinking here (and I appreciate other people seem to be wired up differently) is that you would not generally write
and SQL syntax does not allow you to writeCode:AND 'Smith' = e.ename
You instead put the the column to test on the left, and the value or expression you have already established on the right. Thus,Code:AND NULL IS e.deptno
and likewiseCode:AND e.ename = 'Smith' AND e.deptno IS NOT NULL
Whichever way around you write it, all SQL cares about is that the (+) operator is immediately to the right of the key from the outer joined table.Code:SELECT x, y, z FROM tmp_epg_txs_ids etd , txs_containers tc , aspect_ratios ar , formats f , ancsvc st , epg_templates et WHERE tc.id = etd.id AND ar.id (+) = tc.aspect_ratio_id AND f.id (+) = tc.format_id AND st.ancsvc_cod (+) = tc.ansv_method_st_code AND et.id (+) = tc.epg_template_id; SELECT x, y, z FROM tmp_epg_txs_ids etd JOIN txs_containers tc ON tc.id = etd.id LEFT OUTER JOIN aspect_ratios ar ON ar.i = tc.aspect_ratio_id LEFT OUTER JOIN formats f ON f.id = tc.format_id LEFT OUTER JOIN ancsvc st ON st.ancsvc_cod = tc.ansv_method_st_code LEFT OUTER JOIN epg_templates et ON et.id = tc.epg_template_id;




Reply With Quote