Oto Twoje zapytanie przepisane przy użyciu składni ANSI-92 JOIN:
SELECT a.abx_apo_number,
COUNT(ap1.process_mode) AS NUM_PLANNING,
COUNT(ap2.process_mode) AS NUM_SETUP,
COUNT(ap3.process_mode) AS NUM_OUTPUT
FROM ABX a
LEFT JOIN USER_INSTANCE u ON u.abx_apo_number = a.abx_apo_number
LEFT JOIN ACTIVE_PROCESS ap1 ON ap1.process_instance_number = u.instance_number
AND ap1.process_mode = 'PLANNING'
LEFT JOIN ACTIVE_PROCESS ap2 ON ap2.process_instance_number = u.instance_number
AND ap2.process_mode = 'SETUP'
LEFT JOIN ACTIVE_PROCESS ap3 ON ap3.process_instance_number = u.instance_number
AND ap3.process_mode = 'OUTPUT'
GROUP BY a.abx_apo_number
(+)
to specyficzna dla Oracle składnia LEFT OUTER JOIN. Aby go usunąć, wymagałoby to, aby każdy USER_INSTANCE.instance_number
musiałby mieć wartości dla wszystkich trzech trybów procesu:PLANNING, SETUP i OUTPUT - pomiń jeden, a abx_apo_number nie zostanie wyświetlony na wyjściu.