The convention here is to bottom post or inline responses.
On Wed, Jul 1, 2020 at 9:51 AM David Gauthier <davegauthierpg@xxxxxxxxx> wrote:
Actually, I want the outer join first. If it finds something, then move on to the inner join and filter out all those that don't join to a rec with 'autosmoke'. But if the outer join does not connect to the workarea_env table, then just return what you have (the purpose of the outer join)
So your final result - ignoring columns - is basically:
(sqf, (workarea, events))
where either the entire (workarea, events) is null, or if it is non-null then workarea must also be non-null
Thus: ((workarea is left joined against events) with the whole thing left joined against sqf). And we are back to the join ordering precedence since what you originally wrote was ((sqf, workarea), events).
In short - two outer joins; you can work out precedence either with syntactic order or parentheses.
David J.