, LEFT OUTER JOIN ON, WHERE. , WHERE, .
When I used Oracle, I used archaic (+) after the joined table (with all conditions, including join conditions in the WHERE clause), because this is what I knew. When we became a SQL Server store, I was forced to use LEFT OUTER JOINs, and I found that they did not work as before until I discovered this behavior. Here is an example:
select NC.*,
IsNull(F.STRING_VAL, 'NONE') as USER_ID,
CO.TOTAL_AMT_ORDERED
from customer_order CO
INNER JOIN VTG_CO_NET_CHANGE NC
ON NC.CUST_ORDER_ID=CO.ID
LEFT OUTER JOIN USER_DEF_FIELDS F
ON F.DOCUMENT_ID = CO.ID and
F.PROGRAM_ID='VMORDENT' and
F.ID='UDF-0000072' and
F.DOCUMENT_ID is not null
where NC.acct_year=2017
source
share